Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Query about PDF creator Plugin

 

 


MickC
User

Sep 16, 2011, 7:21 AM

Post #1 of 5 (1069 views)
Shortcut
Query about PDF creator Plugin Can't Post

I have just bought the PDF creator plugin and installed it, after a few fixes it is working.
I have also bough the Cookbook, and scoured the forum and the cookbook for an answer for this:

I have a listing of used equipment, each record of which links to a detail page for each item. I also created another detail page which will be converted to PDF so the customer can print off, email etc.

Every time i put the code into the page i get the following issue:

If i put the createPDF code like this:

Code
in the header 
<?php if (@$_REQUEST['pdf']) { createPDF_fromOutput('inline', 'example.pdf'); } ?>

in the body
<a href="http://used.haeuslers.com.au/listing/listingInfoSheet.php?pdf=1&<?php echo $listingsRecord['num'] ?>">CLICK TO CONVERT THIS PAGE TO A PDF</a>

Quote
which id about halfway down the page, i get an error like this:
createPDF_display: Can't output PDF because headers already sent! Output started in /home/haeusler/public_html/used/listing/listingInfoSheetPrep.php line 125. Make sure you don't have any html or whitespace characters in your code before calls to createPDF_ functions.

If i move it up to the top of the page, it makes a PDF, but it is just a blank white page.

The only errors after i installed and tested it were ones that required me to add the switch to ignore errors.

Running the test in the admin section, the google page works correctly.


Jason
Staff / Moderator


Sep 16, 2011, 9:56 AM

Post #2 of 5 (1062 views)
Shortcut
Re: [MickC] Query about PDF creator Plugin [In reply to] Can't Post

Hi,

Could you attach listingInfoSheet.php to this thread along with a link to a page than demonstrates the problem? That way we'll be able to take a closer look into this

Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/ 


MickC
User

Sep 16, 2011, 7:37 PM

Post #3 of 5 (1058 views)
Shortcut
Re: [Jason] Query about PDF creator Plugin [In reply to] Can't Post

Hi jason.

Thanks for you help mate, it ended up being a DNS problem, of all things!

The domain name it is running on only has entries in our local DNS server, not to the public. I got it to the stage where it would make PDFs of any public website, but all "internal" pages would just come up blank.

Anyway, I made the domain name public and the problem disappeared. Obviousy the PDF engine uses the DNS of the hosting provider to resolve the domain name, which is where i was coming unstuck. Crazy


MickC
User

Sep 16, 2011, 11:56 PM

Post #4 of 5 (1056 views)
Shortcut
Re: [MickC] Query about PDF creator Plugin [In reply to] Can't Post

I tidied a few things up and get it working perfectly,

I even worked out a way to dynamically name the PDF file with a bit of trial and error.. Wink


Code
<?php require_once "lib/viewer_functions.php"; ?> 
<?php
$filename= $listingsRecord['manufacturer']."-".$listingsRecord['Model'];
$num= $listingsRecord['num'];
$url = "listingInfoSheet.php?".$num;
$data = createPDF_fromUrl($url);
createPDF_display('attachment', $data, $filename.'.pdf');
?>


Now the customer's file is meaningfully named, instead of 4 different "example.pdf" files.

Now to play with a few switches and see what else I can do!


Jason
Staff / Moderator


Sep 19, 2011, 9:58 AM

Post #5 of 5 (1025 views)
Shortcut
Re: [MickC] Query about PDF creator Plugin [In reply to] Can't Post

Hi,

That's great! Glad to hear everything is working for you now. Please let us know if have any other questions.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/