Tags:
export1Add my vote for this tag pdf1Add my vote for this tag create new tag
view all tags

Question

GenPDFAddOn is throwing an I/O error on some images (not all). I don't see any images in temp (C:\Windows\temp) as I'm supposed to (apparently), even when they show up in the PDF.

This appears to be a common problem (as seen here in Support as well as GenPDFAddOnDev), but I can't find a clear description of the work-around.

Environment

  • GenPDFAddOn version: 2 Nov 2007
  • HTMLDOC version: 1.8.24

TWiki version: TWikiRelease04x02x00
TWiki plugins: ForEachPlugin, SpreadSheetPlugin, ActionTrackerPlugin, CalendarPlugin, ChecklistPlugin, CommentPlugin, EditTablePlugin, ExternalLinkPlugin, InterwikiPlugin, PreferencesPlugin, SlideShowPlugin, SmiliesPlugin, StopWikiWordLinkPlugin, TWikiDrawPlugin, TablePlugin, TwistyPlugin
Server OS: Windows 2003
Web server: Apache 2.2.4 (win32-x86-no_ssl)
Perl version: ActivePerl-5.8.8.820 (MSWin32-x86-274739)
Client OS: Windows XP
Web Browser: Internet Explorer 6
Categories: Add-Ons

-- SeanCMorgan - 17 Apr 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Carefully compare the <img tags that fail vs. work. As I recall, the code that extracts the file name from the tag is a bit strict. It might not handle spaces in file names, or all delimiter types. However it's been a long time since I looked at that code. It may have changed since then.

For temp files, I believe that they get cleaned up at end of execution unless you enable the debug flag.

-- GeorgeClark - 25 Apr 2008

The problem seems to be with the images themselves: if I change only the file name (no spaces) in the line with image tag, it bombs at the point where it used to work. The attached "Keyboard.gif" works, "AutologinUsername.gif" won't (even with a shorter name).

-- SeanCMorgan - 07 May 2008

If that's the case you could try to run htmldoc outside of TWiki and see if it will fail there as well. If htmldoc fails, then you might want to check with them or try a newer version. I looked at your two GIF files with the gimp and ImageMagick and didn't spot anything significant.

-- GeorgeClark - 08 May 2008

It works fine with the HTMLDOC Windows, which brings me back to the AddOn frown

In fact the GUI fixes so many of the issues I'm having with the AddOn, I'm wondering why others haven't mentioned them. Maybe my installation is messed up? Is it "normal" for me to have the following problems?

AddOn Problems Fixed with GUI? Remarks
1. Error on some images YES -
2. Numbered ToC is not right-justified YES -
3. Loses any text before a TWiki ToC (e.g., Title and Description) because it does not evaluate VIEW_TEMPLATE (TWikibug:Item4437) YES -
4. Links are not visible:
-> external links (white on white) are invisible
-> internal links (black on white) are not visibly hyperlinked
YES Can be fixed by setting link color to blue with the GUI. The same option can be set in the .pm file, but the AddOn still doesn't render it properly. This was requested by TWiki:Main.YuvalAviel on 07 Dec 2006 (TWiki:Plugins.GenPDFAddOnDev)

-- SeanCMorgan - 15 May 2008

I'm several release behind on HTMLDOC:

  • HTMLDOC 1.8.25 (Nov 18, 2005) adds new fonts, improves header support, and improves CGI support on Windows. It also fixes a number of rendering issues.
  • HTMLDOC 1.8.26 (Apr 03, 2006) improves table formatting and PostScript and PDF output. It also fixes a first page header bug in the GUI.
  • HTMLDOC 1.8.27 (Aug 02, 2006) fixes several rendering, output, and networking issues.

I'd appreciate it if anyone could provide a pointer to free Windows binaries for that version.

-- SeanCMorgan - 12 Jun 2008

I finally found a pointer to free Windows binaries for 1.8.27 at <http://www.mediawiki.org/wiki/Extension:Pdf_Export>. That helped with issues #1 & 4 in my table above, but I'm still getting errors on some images.

I tried fiddling with HTMLDOC's no-jpeg and jpeg quality flags but that didn't help. I also tried converting the image to GIF, PNG, and even BMP. It just doesn't like those images!

When I use Foxit Reader to view the PDF generated with the plugin, those images show some corruption. But they aren't corrupted when the PDF is generated with the HTMLDOC GUI or the command-line. So the plugin must be the cause the problem, maybe with some combination of command line arguments different from mine:

htmldoc --webpage -f CLI.PDF --format pdf14 --book --no-embedfonts --linkcolor #0000FF http://<topic's URL>?cover=print

-- SeanCMorgan - 18 Jun 2008

I finally have a work-around:

push @htmldocArgs, "--no-compression"; # Work-around for intermittent image corruption problem

-- SeanCMorgan - 18 Jun 2008

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif AutologinUsername.gif r1 manage 38.1 K 2008-05-07 - 23:04 UnknownUser A generated PDF will bomb when it gets to this image.
GIFgif Keyboard.gif r1 manage 50.0 K 2008-05-07 - 23:03 UnknownUser A topic with this image will work
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2008-06-18 - SeanCMorgan
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.