Generate PDF of Article from Link or Button

Phoca PDF - creating PDF documents in Joomla! CMS
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Generate PDF of Article from Link or Button

Post by Jan »

Hi, the first link is Joomla! 1.5 demo, the second Joomla! 3 demo. I works for Joomla! 3.0, 3.1, 3.2, 3.3, 3.4

It is different for Joomla 1.5, Joomla! 2.5 and Joomla! 3.x - so all Joomla! 3 versions work the same.

So in Joomla! 1.5 there is format=phocapdf but since Joomla! 2.5 there is no core PDF function in Joomla! so since 2.5 Phoca PDF can use standard format=pdf

Jan
If you find Phoca extensions useful, please support the project
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

Thank you, that helps me.

I have enabled PHP error logging and checking on my test site. I also enabled error reporting under Joomla. There were NO PHP errors reported. There were some minor warnings with 2 specific extensions. I disabled both so that now there are NO errors and NO warnings. The bad news is the Phoca PDF extension still generates a blank page. It adds the header and footer as I specified but the page content is not shown in the PDF.

Any other ideas?

Also, I tested a simple text only page with the same result. A blank PDF with header and footer but no content. I also removed 2 minor javascript errors, but same result, no content.

Ken
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

Hi,

Is there anything more you can offer on this? Clearly, Phoca PDF is not working and based on what I have seen so far it could be for any number of reasons, but not because of PHP errors on my site. There are NO PHP errors on my site.

Could it be a conflict with other extensions? Are there any known issues reported with other extensions, if so, which extensions?

To ensure it is installed correctly let me summarize what is installed currently on my site from Phoca PDF. I have all of the following installed and enabled on my site,

Name Type ID Version
Phoca PDF Component ID=10534 3.02
Phoca PDF Content Plugin ID=10535 3.02
Phoca PDF System Plugin ID=10536 3.02

Is this correct? Should all of these be installed and enabled at the same time? I have no desire to have the PDF added to the PRINT/EMAIL menu, since I do not use this menu, so should I unpublish the Phoca PDF System Plugin?

Ken
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Generate PDF of Article from Link or Button

Post by Jan »

Hi, Joomla! is a system which is build from many parts so of course, everything can be influenced and everything can influence other parts of the system.

It depends on which Joomla! version you are running Phoca PDF:

If on Joomla! 3 then you should run Phoca PDF 3, Phoca PDF content plugin 3 and Phoca PDF system plugin 3.

Creating of PDF on your website is really difficult feature - this is e.g. why this function is not a part of core Joomla! as it is very problematic - PDF is not like HTML and there can be a lot of problems.

But here:
https://www.phoca.cz/joomla3demo/phoca-pdf-demo on this site you can see that if everything is Ok on the site (no php problems, no conflicts with other extensions, etc.) everything is working OK

1) you need to run Phoca PDF component to have the basic features
2) you need to run Phoca PDF system plugin to display the PDF icon on your article page - you can do it per manual customization too
3) you need to run Phoca PDF content plugin to translate the html to pdf which is set in your article.

Of course, the article code should be as easy as it can be - if there is some difficult HTML it can have problems when transforming from HTML to PDF - because HTML is dynamic and PDF is static (it is really large transformation which is made there) and of course if there is some other plugin inside the article which has problematic html output (html, css, js, ...) then this all can prevent from successfully displaying of the PDF

Mostly if there is a problem, it can be read in php error message - but everything is not so easy like by html

1) the php error can be displayed before printing PDF - on the site - this is OK and when php error reporting is enabled - it is easy to read the problem
2) the easiest way is to read the error directly in errorLog on your server
3) but the error can be printed in PDF document - in such case, you can download it but it will be corrupted - when opening it in text editor, you can see the php error directly in source code of the PDF.

So nothing is easy as it seems - there are so many factors which can influence it (web server settings, php settings, cms settings, different conflicts with other extensions, problematic html code, etc. etc.)
just see the important notice e.g. here: https://www.phoca.cz/phocapdf
:idea:

Jan
If you find Phoca extensions useful, please support the project
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

Thank you. I re-enabled error reporting on the site and attempted to generate a PDF again. This time I got a long message through the error report, but I can see no error indicated. I tried pasting the entire message but it was too big for your site. The next post will include the first 5 and last 20 lines. The middle is the same kind of garbage text,

This tells me nothing useful, hopefully tells you something!

Ken
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

First 5 lines,

%PDF-1.7 %âãÏÓ 10 0 obj << /Type /Page /Parent 1 0 R /LastModified (D:20150331123623-04'00') /Resources 2 0 R /MediaBox [0.000000 0.000000 612.000000 792.000000] /CropBox [0.000000 0.000000 612.000000 792.000000] /BleedBox [0.000000 0.000000 612.000000 792.000000] /TrimBox [0.000000 0.000000 612.000000 792.000000] /ArtBox [0.000000 0.000000 612.000000 792.000000] /Contents 11 0 R /Rotate 0 /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> /Annots [ 7 0 R 9 0 R ] /PZ 1 >> endobj 11 0 obj <> stream xœÍTKsÚ0Ö™_±Ç䀐d=sl)™æ­oI-ÚN)0ãößwEâ±~¤™J£ñzíýVúôí2ªÃ)0¸Áõnïñ‘àºÆµ¼‹a4Àe‡ñ>ÄÖ,W·O"àìøÃÁ-ó¶‰êóתñé:z«˜v›C–8ž/ÜÃÈeæ|Ý v‹ìæ ~J›½IAwÚ*0JQ-´1óÀè#‡ñfÿ 3³¦Ò![Ì~JK©¡/:ÄûeqƒßLPã¸ç{
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

One additional thing, I tried some online service to create the PDF of the same pages I have been testing Phoca PDF on and it generated the PDF perfectly, no errors and no issues. It is a paid service, which I am fine with, but I would prefer how the Phoca PDF integrates if I can get it to work. At this point I am near to giving up completely on Phoca PDF. I get how you say it is complicated, but honestly when I see how well web2pdf converts, that tells me that maybe Phoca has not kept up with the pace of web development.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Generate PDF of Article from Link or Button

Post by Jan »

Hi, can you paste the link to the PDF.
There is no error, but there can be some wrong html formatting - so you can test it with some simple article - e.g. abc and then add some more text - to only test if the basics of PDF feature works :idea:

Jan
If you find Phoca extensions useful, please support the project
kefford
Phoca Member
Phoca Member
Posts: 19
Joined: 07 Mar 2014, 06:19

Re: Generate PDF of Article from Link or Button

Post by kefford »

Sorry, did not see this response. Your messages do not forward to my email, they seem to require manual checking of your forum. Strange limit.

Anyway, as explained before I have already tested numerous simple articles from my site, including ones with a few characters of text. The same results were obtained, no PDF content was created. Just a blank PDF with header and footer as specified. However, all simple and complex site pages are generating good PDFs from web2pdf.com service. Also, as explained many times, my site has NO errors as you are suggesting.

Regarding the link to the PDF, what link are you asking for?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Generate PDF of Article from Link or Button

Post by Jan »

Hi, some link to simple article where there will be the PDF icon, so I can test to click on it.

If you have installed some specific system plugins, you can try to disable them, to prevent from influencing them on the PDF creating (only for test)

Jan
If you find Phoca extensions useful, please support the project
Post Reply