Extension talk:Pdf Export/Source Code

Add topic
From mediawiki.org

Syntax?[edit]

It looks like 3 of the code blocks below are missing the closing PHP angle bracket "?>"

Is true? I cannot seem to get this extension working via copy-paste.

--216.226.127.130 14:09, 14 January 2009 (UTC)Reply

You dont need an end bracket in these files. In fact its more secure not to use them because this way you dont print out any content accedently after the php script! The end of file acts like "?>". regards --Benjamin Garn 16:13, 14 January 2009 (UTC)Reply

I also had this problem, so I ... removed the ?> and now it works! Bye and thanks for this extension. Enzo

Always get a 0 byte file (SOLVED)[edit]

It seams that I have installed s.th. wrong. If copy&paste the content and it didn't works. Then I've removed the "?>" at the end of all 4 files, but it still seams the same issue. Has someone an idea? Thx Torsten


Hi, dont forget to install htmldoc package. Like on yum based distros:

yum install htmldoc

Hello everyone, I have a problem, I copy pasted the files in the directory, I htmldoc file on the root directory of the site, I do the include, I put in the variable htmldoc path got anything on my PDF.

Where I install htmldoc, I don't know : with pages I need your help thank you.

PetitNico

I can't export images[edit]

Hi, I can configured this extension, but when I export to PDF a page with images, those isn't display in PDF document.

Empty name for Special Page -> PDF Export -> file name[edit]

While the Special page for PdfExport kindly suggests file name 'print.pdf' for a multiple-page PDF export, the file that my browser (either Firefox or IE) offers to save is named '.pdf'. Is this a browser particularity, a MediaWiki settings issue or a bug? -- Saruman! 13:39, 2 September 2009 (UTC)Reply

PdfExport_body throws warnings[edit]

There are two sections of code that throw warnings:

Line 83:

                       if ($f == null) {

There is no value for $f defined. This doesn't seem to affect the code's operation though.


Line 114:

                       $returnStatus = proc_close($process);

There is no $process variable. Should it be $htmldoc_process?

These actually cause failures for us so I corrected the code to:
       foreach ($pages as $pg)
           {
           $f = $this->save1page ($pg);
           if ($f == null) {    continue; }
           $pagestring .= $f;
           }
and
       $htmldoc_process = proc_open("htmldoc...
...
       $returnStatus = proc_close($htmldoc_process);

PdfExport_body.php CODE AND FIX yield NOTHING[edit]

OK so.. the CODE is broken and pops its error message into your output pdf (!). the error message states that line 83 has the !DEF var f ... the 'patch' listed above? Yeah. making that change gives you a 0 length file instead.

Another thing i noticed is the line 114 'patch' has been rolled into a branch..Why would one fix be rolled in and not another?

Internal Server Error 500[edit]

The website encountered an error while retrieving https://wiki/index.php?title=Special:Pdfprint&page=Main_Page. It may be down for maintenance or configured incorrectly. Any ideas why its doing this. By the way I had to get a version of wget for windows to get the files as for some reason copy and past screwed your code up. So close to working just a dam error. Site has been working with no problems before the extension was installed.


Ok, I am running IIS and need to allow the CGi which I have done. Installed HTML Doc and allowed the EXE to run and the msvcr71.ddl to run just in case still a 500 error what else is being restricted from running any ideas?