PDF for download

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

frelopes
Posts: 2
Joined: Tue Oct 13, 2009 3:37 pm

PDF for download

Post by frelopes » Tue Oct 13, 2009 3:41 pm

Is there any plugin that converts the html "Print version" to downloadable pdf?
Thank you!

Holger
Site Admin
Posts: 3209
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany
Contact:

Re: PDF for download

Post by Holger » Tue Oct 13, 2009 9:57 pm

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

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: PDF for download

Post by johnjdoe » Wed Oct 14, 2009 6:35 am

Here is an other solution from the archived forum: http://www.cmsimple.dk/forum/viewtopic.php?t=1691

frelopes
Posts: 2
Joined: Tue Oct 13, 2009 3:37 pm

Re: PDF for download

Post by frelopes » Fri Oct 16, 2009 12:45 am

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!

Till
Posts: 337
Joined: Tue May 20, 2008 7:20 am
Location: Germany: Bremen
Contact:

Re: PDF for download

Post by Till » Sat Oct 17, 2009 7:49 am

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

Till
Posts: 337
Joined: Tue May 20, 2008 7:20 am
Location: Germany: Bremen
Contact:

Re: PDF for download

Post by Till » Sat Oct 17, 2009 1:03 pm

I just learned that this PDF function works in CMSimple 3.2 but not in my CMSimple32_v10_beta3_XH version.

Till

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: PDF for download

Post by johnjdoe » Sun Oct 18, 2009 6:50 am

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.

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: PDF for download

Post by johnjdoe » Sun Oct 18, 2009 6:51 am

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!

Tata
Posts: 3154
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: PDF for download

Post by Tata » Sun Oct 18, 2009 9:45 am

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?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Till
Posts: 337
Joined: Tue May 20, 2008 7:20 am
Location: Germany: Bremen
Contact:

Re: PDF for download

Post by Till » Sun Oct 18, 2009 11:20 am

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

Post Reply