PHP Classes

Working with a PDF stream

Recommend this page to a friend!

      PDF print  >  All threads  >  Working with a PDF stream  >  (Un) Subscribe thread alerts  
Subject:Working with a PDF stream
Summary:I already have a pdf generator creating a pdf
Messages:8
Author:Lunch
Date:2010-11-02 06:50:39
Update:2014-02-28 04:38:35
 

  1. Working with a PDF stream   Reply   Report abuse  
Picture of Lunch Lunch - 2010-11-02 06:50:39
I already have a pdf generator creating a pdf on the file, how can I pipe it into the class before finally outputting? I thought I could just give it the data instead of the file, but that won't work since the class tries to open a real file internally.

  2. Re: Working with a PDF stream   Reply   Report abuse  
Picture of Freddie Leeman Freddie Leeman - 2010-11-06 12:11:37 - In reply to message 1 from Lunch
I'm also interested in this. I already have the original pdf in a string, can the script be enhanced so it accepts strings as well?

  3. Re: Working with a PDF stream   Reply   Report abuse  
Picture of Laurens Ramandt Laurens Ramandt - 2010-11-09 22:09:29 - In reply to message 2 from Freddie Leeman
Hi,

I will look into this in the first few days.
Thank you for your positive feedback!

  4. Re: Working with a PDF stream   Reply   Report abuse  
Picture of Laurens Ramandt Laurens Ramandt - 2010-11-16 08:33:31 - In reply to message 2 from Freddie Leeman
Hello,

I enhanced the script in a way that it's possible to input a file contents string

You can find the new version in the file `class.pdffile-loadContents.php`

Similar to the 'normal' example script, you can use the enhanced class as follows:

<?php
require("class.pdffile-loadContents.php");

//adapt this line to your likings ; assign the pdf contents you got from elsewhere, to the variable $pdfContents.

$pdfContents = file_get_contents("...pdf");

//example A: insert javascript and save as new file
$obj = new pdfFile("", $pdfContents);
$obj->insertPrintCode();
$obj->saveAs("example-print.pdf");

//example B: insert javascript and output the file
$obj = new pdfFile("", $pdfContents);
//sets the header information, automatically inserts print code
//and echos the pdf contents (cfr. __toString method)
echo $obj;
?>

Good luck!

  5. Re: Working with a PDF stream   Reply   Report abuse  
Picture of Lunch Lunch - 2010-11-16 11:27:23 - In reply to message 4 from Laurens Ramandt
cool thanks!

  6. Re: Working with a PDF stream   Reply   Report abuse  
Picture of evishy evishy - 2012-01-10 07:26:18 - In reply to message 4 from Laurens Ramandt
I m trying to use this clas, but pdf is not getting printed automatically, I just see the pdf opening and thats it.

  7. Re: Working with a PDF stream   Reply   Report abuse  
Picture of arron wall arron wall - 2014-02-28 04:28:31 - In reply to message 6 from evishy
How about printing PDF files with the help of some 3rd party PDF manipulators?
yiigo.com/guides/vbnet/how-to-start ...

  8. Re: Working with a PDF stream   Reply   Report abuse  
Picture of Lunch Lunch - 2014-02-28 04:38:35 - In reply to message 7 from arron wall
is there vb.net in linux?