I needed a function to VM 1.1.8 in Joomla 1.5.22, to permit contacting of pdf invoice to clients who had their purchases confirmed. I have attempted various plug ins, non works generate an income wanted. Thus I am coding it myself.

To lessen dependency, I have selected to make use of pdfcrowd.com to complete the html to pdf conversion, as suggested by some stackoverflowers here. However, I am now facing one problem in which the page to become converted should be openly view-able to ensure that pdfcrowd to determine the output otherwise the pdf will eventually ends up with only the admin login page. I am been searching around, although not getting anything near, maybe I am while using wrong search phrases.

I have also attempted to create a completely independent php page to show a public invoice, however it was an excessive amount of hassle to create everything to really make it works without poking into joomla's internals.

The page that I am attempting to reproduce is

administrator/index.php?page=order.order_printdetails&order_id=######&no_menu=1&pop=1&tmpl=component&option=com_virtuemart

that is /administrator/components/com_virtuemart/html/order.order_printdetails.php

Btw, I'm going to be applying once token look for the invoice view page, to ensure that it may simply be used in a brief time period for conversion. Converted invoice is going to be saved and used again later as needed.

Please advise. Thanks.

EDIT: Because of LAS_Las vegas for pointing to cURL. His code works best for public page. To gain access to drenched in page, I simply need to add code to pass through the cookie over.

<?php
// no direct access
defined('_JEXEC') or die;

//Store cookie in format compatible with cURL
$cookie = "";
foreach($_COOKIE as $key => $value) {
    $cookie .= $key . "=" . $value . "; ";
}
$ch = curl_init();
$fp = fopen("example_page.html", "w");

curl_setopt($ch, CURLOPT_URL, "http://www.example.com/administrator/index.php?page=order.order_printdetails&order_id=######&no_menu=1&pop=1&tmpl=component&option=com_virtuemart");
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

You should use PHP curl library in order to save the web page to some location in your server.

<?php
// no direct access
defined('_JEXEC') or die;

$ch = curl_init("http://www.example.com/administrator/index.php?page=order.order_printdetails&order_id=######&no_menu=1&pop=1&tmpl=component&option=com_virtuemart");
$fp = fopen("example_page.html", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

You'll be able to forward the link to this saved file to pdfcrowd.com.

However you have to run this script from from Joomla framework, otherwise it will not have the ability to access the page.