Export blog as PDF doesn't work

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
TKS
Regular
Posts: 199
Joined: Thu Nov 11, 2004 1:34 am
Location: VA, USA
Contact:

Export blog as PDF doesn't work

Post by TKS »

My Blog: http://linux-blog.org

I've installed the plugin and the links are present at the end of each entry...but the result in various errors when trying to view the pdf...mainly having to do with Unhandled MIME types. I've seen both text/plain and application/octet-stream errors. Screenshot provided below:

Image

Not sure what the problem is, but no matter what combination I use on the plugin settings page, nothing works.

Any help is appreciated.

One point of contention also...when a person attempts to download the entry...it names the entry doc.pdf. Couldn't this behavior change to use the entry # or first 7-9 letters of the entry? Seems silly to have it be doc for each download.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Export blog as PDF doesn't work

Post by garvinhicking »

Hi!

IF you download the PDF link and view it with an editor, you will see PHP errors that tell you your /archives directory is not writable to store the PDF. This renders the PDF file invalid.

As for changing the doc.pdf name to something different, that would be good. Sadly I don'T have the time to look into the full API of the fpdf library to see how to change the PDF filename. If someone wants to have a look, I'd happily include the patch that'S required for it.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
gregman
Regular
Posts: 91
Joined: Wed Aug 15, 2007 9:32 pm

Re: Export blog as PDF doesn't work

Post by gregman »

garvinhicking wrote:Hi!
Sadly I don'T have the time to look into the full API of the fpdf library to see how to change the PDF filename. If someone wants to have a look, I'd happily include the patch that'S required for it.
Hi there,

the Output-Function has two parameters: $name for the filename and $dest for the destination ('I' for inline, 'D' for download). So you can call the Function e.g. via

Code: Select all

$this->pdf->Output("my_filename.pdf",'I');
to have the file named "my_filename.pdf" and opened within the browser.

Greg
Post Reply