in reply to PDF::API2 Questions

Is there any way to print the content of a pdf on a webpage without saving the new pdf you have made on the hard drive ? For example. You are making a new PDF , write smth to it and after you are done except saveas is there any other way to display or write it the another $string and print it out after that. Like print "Content-type: application/pdf\n\n"; I am talking about using AIP2.

Replies are listed 'Best First'.
Re^2: PDF::API2 Questions
by Corion (Patriarch) on Mar 22, 2012 at 14:18 UTC

    Have you looked at the ->saveas method in the PDF::API2 documentation? Documented right below it is the ->stringify method which is documented as

    Returns the document as a string.

    Have you tried using that method? How could that documentation be made more clear?

      A decade on and the ->saveas method has been deprecated...

      However, to get the PDF directly sent to a browser, the ->to_string method works just fine.
      At least it does when one remembers to set the correct MIME type as application/pdf!