|
Cookbook /
PmWiki2PDF-TalkSummary: PmWiki2PDF Talk Page
09/22/2006 Alain FDPF errors under PHP 5.xx Warning : the embedded version of FPDF isn't PHP5 ready. The pdf appears as garbage on the navigator window instead of being sent to acrobat. FDPF uses $HTTP_VARS_SERVER which does not exist anymore on PHP5, instead of $_SERVER. Changing all occurences (and suppressing accordingly "Global" declarations) in fpdf.php solves the issue. 20.Juni.2006 hh ( hh(at)11h.de ) I also cant get the images. It is possible to convert normal pages. With images this error appears: Result from loading pmwiki-32.gif renamed as bildtest.gif FPDF error: GIF parser: unable to open file http://137.22.221.134/wiki/pmwiki/uploads/bildtest.gif(approve links) But it is possible to open the image, the file header is converted wright way. The real reason is there: from gif.php: do { if(!$this->m_img->load($this->m_lpData, $imgLen = 0)) {
$this->m_HHData.="zzz".$this->m_img->m_data."http666"; #########################
return false;
}
$this->m_lpData = substr($this->m_lpData, $imgLen);
}
while($iIndex-- > 0);
What can be the reason?? With .png there are other Errors. There is a new script from 2006-05-28 Valentin Schmidt supporting Alpha channel see http://fpdf.org and there scripts At the site of http://html2fpdf.sourceforge.net/ there is no example with images and probably my not working images are containing alpha channels. Maybe this new script can be integreted and will solve the problem!
// Right after $pdf = new HTML2FPDF(); on line 53: $pdf->DisableTags('<span>'); => the_CName : okay, thanks ... I've seen this problem ... Iv'e create a new archive with this implement in my code ! Is egual with this report bug in HTML2FPDF ? I believe it ... Ok, I'm having to change my opinion because this recipe breaks the break-page one. Also, inline styles son't appear to come over too well.PB Beside the markup "====/(:breakpage:)/____" break_page.php and break-page.php scripts add an action to $HandleActions. Because pmwiki2pdf.php redefines $HandleActions the break page scripts break if they are included before pmwiki2pdf. Maybe it would be enough to append a pdf action $HandleActions['pdf'] = 'HandlePDF'; in pmwiki2pdf.php? - Schlaefer August 21, 2005, at 03:51 AM
the_CName - 2005-08-21 :: 16:45
for translate to PDF.
The problem PB mentions is that you write in $HandleActions = array( 'browse' => 'HandleBrowse', 'edit' => 'HandleEdit', 'source' => 'HandleSource', 'attr'=>'HandleAttr', 'postattr' => 'HandlePostAttr', 'pdf' => 'HandlePDF', ); So you overwrite the $HandleActions['pdf'] = 'HandlePDF'; Schlaefer August 21, 2005, at 10:22 AM the_CName ok, i modify and test it ... and create a new archive ! Thank to you ...
PB I just updated both recipes on my wiki and its working like a champ! Thank you both for your hard work on this!
(25AUG05)--Ok, so here is a crazy question. Can I automatically append an XMP file into the dynamically created PDF. The reason would be so that info contained in the PDF would have the same licensing as the wiki page (Creative Commons, for example, provides the XMP file needed). I'm just wondering if it can be done. For all I know the functionality is already there and I'm missing it when looking over all the component webpages on SourceForge.PB
add in function HandlePDF() this :
(27AUG05)--It's not exactly what I'm looking for since it doesn't update the XMP of the PDF created, but it is a workable solution as long as people don't remove the license from the end of the PDF. I didn't realize how easy it was to add info to the PDF dynamically, this recipe and the underlying technology are fantastic! Thanks for all your help with my issues! PB
Vincent Voois August 27, 2005, at 12:04 PM the_CName I've the same pb with Adobe Reader 7.0 and this integration in browser web on Windows...
For your URL problem in your file, it's possible to see an URL ?
I've seen the scaling problem with the image embedded. How correct it ? I dont know...
I've change the word "hacked" by "created" or "modified"... but i dont repackage now. (because it's not a pb !)
Stephane Smets 14 sep 2005 - 08h20
I have a strange things : the generated filename for the pdf doesn't contains the extension, so the browser ask for download instead of showing the pdf. I try to look into the code, and.. find a line where the extension is added. So, ... bug? Other thing, as mentioned by Vincent Voois, no picture is added in the pdf. IS there plans to change this? the_CName 27 sept 2005 : use the tip of Christophe David below !
Christophe David 2005/09/18 The generated pdf files do not include the images from the HTML page due to the fact that an incorrect path is supplied to fopen() in html2fpdf.php. This can be corrected by replacing line 218 $this->basepath = '';
by $this->basepath = $_SERVER["DOCUMENT_ROOT"];
the_CName 29 sept. 2005 : please, no modify the html2fpdf script but -1- modify the variable $xyz['path'] or, -2- use directly the method $pdf->setBasePath(...) in pmwiki2pdf script ! ;-)
How to generate the PDF file with the title (eg. PmWiki2PDF)? currently it only has the contain but without the title (or the path of the wiki) -rhiino 9/21/2005 the_CName 27 sept 2005 : I don't understand your problem ... pmwiki2pdf generate the title. ->You can try to modify in pmwiki2pdf script, the value of the variable $xyz['name'][pdf'], or the pdf->Output (plz, for this, seen the fpdf documentation !) Stephane Smets 28 sep 2005 - 08h40 You can easily change in pmwiki2pdf.php the line : RussFink 2005/09/24 There is a conflict with this and NumberedHeaders. Just by including the NumberedHeaders php script without actually using it, the ! headers will not appear at all in the PDF output. This is a showstopper of sorts, if you need numbered tables of content. the_CName 29 sept 2005 : i work on this pb
this script NumberedHeaders run differently that PageTableOfContents... 'n it "break" the output pdf ! I then tried with PageTableOfContents, and the PDF generates the following output. Headers do appear, and it does a nice job of automatically linking the sections and providing bookmarks in the output; however, it includes some funny "&ensp" markups in the output : On this page... 1. Wiki Content 1. 1.1  Academic 2. 1.2  Practical (non-Academic?) 3. 1.3  General Content 2. Outside Content 1. 2.1  Humor the_CName 29 sept 2005 : this is corrected on version 20050929 !
4. Oktober 2005: I noticed a security hole... the script deliveres PDF files of documents the user has no right to see. e.g. I passwort-protect a document, when viewing it it tells me to enter a password. But if I add ?action=pdf a PDF file is being generated and displayed. I double-checked with installing a naked fresh system with the latest version of both pmwiki and pmWiki2PDF and I get the same effect. Uli 4 Octobre 2005 : It's not necessary to write me in red ... 'n cause afraid all people. -- Yes, i've just test your explication, and i've seen the problem. I don't know how it's possible to include a password verification. I will try to join Pm... to explain me how can i implement this. ->Thanks for checking on that so quickly. I just saw that the extension Cookbook/GeneratePDF does the password check, I assume it simply calls the correct function to get the document content. -Uli
6 Octobre 2005: In pmwiki2pdf.php, near line 35, replace:
$page = ReadPage($pagename); with:
$page = RetrieveAuthPage($pagename, 'read', true, READPAGE_CURRENT); That should do the trick. --Dfaure
the_CName 10/10/2005 Ok, that's run correctly ... thank you, Dfaure !
10. October 20005 Please explaine me the differen methods
What is there meaning? How do I use them? --fraz the_CName 10/10/2005
The methode setBasePath resolve a path image bug ... this return the server DOCUMENT ROOT to include correctly the path of image in your output pdf (for windows server or station) and the both others methods exists to use two HTML2PDF features, understand correctly the element PRE (but, i think no good ; see my site http://devht.stephane-huc.net/Test/Index ) and the style CSS. If you have one problem, plz, report them on HTML2FPDF Forum ! How do I enable the different methods or is the fitting method selected automaticaly? fraz
the_CName 2005-11-20
Plz, explain-me what's change with my ultime writing (2005-10-10) on pmwiki2pdf ??? that's run correctly and so secure ! no ?
december 10, 2005 - hfwang For some reason the PDF document created with this recipe do not contain any images. I treid the above solution, even the hardcoded part in the main script, but no luck. Can somebody please take another look at this 'issue' please? TIA the_CName 2005-12-12
verify the variable $xyz['path'] as egual : $xyz['path'] = $_SERVER["DOCUMENT_ROOT"];
|