Page 1 of 4

PDF for download

Posted: Tue Oct 13, 2009 3:41 pm
by frelopes
Is there any plugin that converts the html "Print version" to downloadable pdf?
Thank you!

Re: PDF for download

Posted: Tue Oct 13, 2009 9:57 pm
by Holger
Hi frelopes,

I've moved your posting to the Plugins-Forum because it's a plugin request, not CMSimple_XH related.

Back to topic:
frelopes wrote:Is there any plugin that converts the html "Print version" to downloadable pdf?
I've developed such a plugin a long time ago.
You can see it at http://www.thermalcamping.de/?Die_Stadt_P%26aacute%3Bpa (click on the little pdf-button in the lower right, below the page content). The created PDF is nearly "wysiwyg", when the used fonts are present at the webserver (not in this demo). It can open the PDF in a new window/tab and/or provide the file for download (browser-depending).

I've not released it, because the API behind it tooks a lot of memory and time to excecute the skript, so the script often dies with a fatal error (out of memory etc.) on shared hosting.
That's all depending on the generated html. A clean xhtml without nested tables and inline-css works fine in most cases.

Anyway, if you really need such a plugin and if you're experienced in PHP to get it runnig on your host, I'll give a copy of the latest version to you.
But I won't and can't support it for free here at this forum :( .

Cheers
Holger

Re: PDF for download

Posted: Wed Oct 14, 2009 6:35 am
by johnjdoe
Here is an other solution from the archived forum: http://www.cmsimple.dk/forum/viewtopic.php?t=1691

Re: PDF for download

Posted: Fri Oct 16, 2009 12:45 am
by frelopes
Thank you, guys.
Unfortunately I'm not a PHP programmer. I wished to know whether there is some ready to use plugin. If not, patience!
Thank you!

Re: PDF for download

Posted: Sat Oct 17, 2009 7:49 am
by Till
frelopes wrote:I wished to know whether there is some ready to use plugin.
I combined the solution - johnjdoe mentioned - in CMSimplewiki. You can find it at http://www.cmsimplewiki.com/doku.php/addons/pdf_link. However, I changed it in that way, that all code goes into functions.php. In my quick test it works.
Just follow the 4 steps outlined. It is very easy. You do not need to be a programmer to add a few lines of text code.
I am sure this can be transferred into a plugin. However, I think it would be a good idea to add this function to the new CMSimple_XH version.

Till

Re: PDF for download

Posted: Sat Oct 17, 2009 1:03 pm
by Till
I just learned that this PDF function works in CMSimple 3.2 but not in my CMSimple32_v10_beta3_XH version.

Till

Re: PDF for download

Posted: Sun Oct 18, 2009 6:50 am
by johnjdoe
Till wrote: I combined the solution - johnjdoe mentioned - in CMSimplewiki. You can find it at http://www.cmsimplewiki.com/doku.php/addons/pdf_link. However, I changed it in that way, that all code goes into functions.php. In my quick test it works.
Thank you Till! That would help in the future!

By the way: For adding code like this in CMSimple_XH it is better to do this in a file named userfuncs.php who is included by functions.php. We did this to avoid that somebody change functions.php and that his mods will be overwritten by a release.

Re: PDF for download

Posted: Sun Oct 18, 2009 6:51 am
by johnjdoe
Till wrote:I just learned that this PDF function works in CMSimple 3.2 but not in my CMSimple32_v10_beta3_XH version.
Ah!? Hmm, I hope that one of the core coders could help you!

Re: PDF for download

Posted: Sun Oct 18, 2009 9:45 am
by Tata
I tried this function with CMSimple-XH. Everything works well. Only a notice returns

Code: Select all

Notice: Undefined variable: pdf in http://www.mydomain.sk/cmsimple/functions.php on line 54
Does this need any other setting yet?

Re: PDF for download

Posted: Sun Oct 18, 2009 11:20 am
by Till
Tata wrote:Does this need any other setting yet?
I believe svarrer hesitated to declare variables quite often. Add a first line called:

$pdf;

This should do it.

Till