Extension talk:Mpdf/Archive

Images and TOC
Extension seems to be working great so far except for just a few issues...

The first is that no images appear in the exported pdf. They show up as little white boxes with a red x. Is there anything I need to tweak to get these to display properly? When I hover over the x icons it displays a URL in the format http://servernamehere/mediawiki/index.php?title=File:filenamehere.jpg ..could this be the problem since its not pointing to the actual file location?

The second issue is that the TOC doesn't seem to render properly and often breaks the formatting. Is there any way around this? And is it possible to have the TOC links point to the proper section of the actual exported pdf document itself when clicked? This type of extension is exactly what I've been looking for since I need to be able to export PDF but don't have root access so can't use any of the alternate htmldoc extensions, so appreciate any help you can provide! Thanks in advance


 * Hi. When I hover over the x icons it displays a URL - this is normal. By default, picture in the wiki have a link to the page file. This can be corrected by setting link=. Sample: myfile.jpg


 * TOC links point to the proper section of the actual exported pdf document - mPDF has its own means of ToC Index Bookmarks. Please, read mPDF manual


 * TOC doesn't seem to render properly - I'm working on improving render


 * They show up as little white boxes with a red x - This is true for all images or only some of them?


 * in the near future I will make a few examples showing work of this extension --Pastakhov (talk) 04:23, 7 August 2012 (UTC)


 * Thanks for your response, Pastakhov. The little white boxes with a red x show up for all images. I set showImageErrors to true in order to determine what the problem is and after doing so, I receive the msg "mPDF error: IMAGE Error (http://*serveriphere*/mediawiki/images/2/23/Flag-USA.png): Could not find image file" when attempting to export a page to PDF. Any idea what the fix could be?


 * Mpdf required also gd php module for works with images png, svg and etc... thanks for report problem --Pastakhov (talk) 05:26, 10 August 2012 (UTC)


 * Yeah I already have gd enabled, and have checked to make sure I followed the other requirements exactly as you had written. It's not just png files that don't show up, the other image files (i.e. jpg, gif, etc) are not working at all either. Everything else seems to render in the exported pdf without any issues, it's just the images that show up as red x..and if I click the link that the missing image (red x) refer to, the pictures load in the browser fine they just don't appear in the pdf file...any other ideas how to fix this issue? 

You can place them on http://pastebin.com/ --Pastakhov (talk) 04:14, 17 August 2012 (UTC)
 * I need to see the html source of a wiki page and logs from a web server at the time of export to pdf format.


 * What exactly is it that you are looking for from the webserver log? I'm using IIS, and the only line that prints out in the server log when I try to export a page to pdf (with imageerrors set to true in the mpdf file), is for example a line like this: "GET /mediawikiold/skins/common/images/poweredby_mediawiki_88x31.png - 80 - 10.1.19.124 - 401 2 5 0" And on the webpage itself I get a blank page with the error: "mPDF error: IMAGE Error (http://10.1.19.124/mediawikiold/skins/common/images/poweredby_mediawiki_88x31.png): Could not find image file"


 * If I'm not mistaken, IIS return 401 error - Unauthorized. You configure authorization on the web server? --Pastakhov (talk) 06:56, 21 August 2012 (UTC)


 * There are no IIS errors that appear. The pdf itself exports without any IIS error, its just that when I open the exported file on my computer, all of the images are missing and have red x in their place. If I set "$this->showImageErrors = true" in mpdf's config.php file and try exporting a pdf again, it gives me the mpf IMAGE error I wrote in the msg above. Again, the missing images (that show up as red x in the pdf) appear to point to the right file (i.e. if I type them into a webbrowser, the image displays fine), it is just that they are not getting rendered properly in the exported pdf. This goes for both internal images that I've uploaded onto my server (i.e. http://10.1.19.124/mediawikiold/skins/common/images/poweredby_mediawiki_88x31.png) and for external images (i.e. http://upload.wikimedia.org/wikipedia/mediawiki/a/a9/Example.jpg)--none of them show up on the exported pdf.


 * Any ideas for how to resolve this issue so that images show up properly??

I am sorry for the long wait, I'm on vacation until September 17 --Pastakhov (talk) 04:50, 7 September 2012 (UTC)


 * No problem, upon your return if you do have any ideas how to resolve this, I'd love to hear!


 * mpdf return error 'Could not find image file' if can't download image file from web server. it is possible for one of the following reasons:


 * allow-url-fopen disabled by settings in php.ini.
 * not exist or disabled curl library