xsane produces "mess" when saving pdf

Bug #539162 reported by Steven Sciame on 2010-03-15
This bug affects 8 people
Affects Status Importance Assigned to Milestone
xsane (Ubuntu)

Bug Description

Binary package hint: xsane

When scanning a document to pdf format, xsane worked properly 1 time. After that xsane improperly saves the file. I will attach an example. The strange thing is that the document looks ok in the Viewer. When you save the document it gets corrupted.

Ubuntu Karmic

Compaq Presario 2105us

I have the exact same problem, but I am using Jaunty with the latest updates at the time of this comment. My PDFs look just like the attached example.

I only get the mangled PDF when I choose "Gray" as the color mode. (Possible choices are Binary, Gray, Color.) Surprisingly, Color mode scans to a PDF just fine.

When choosing the action (view, save, copy, etc), the Viewer mode works just fine for the PDF, but upon save, it gets mangled (when using Grey).

Neither 100 dpi nor 300 dpi make a difference.

I've also changed Preferences > Setup > Filetype > "Save PDF zlib compressed" to false (unchecked). This had no effect.

For the mangled PDFs (and the successful color ones), Evince shows the "Format" as "PDF-1.4"

When loading *any* PDF that was created with xsane (gray or color) in Evince from the command line, I get a lot of errors like these:

  Error (1734109): Illegal character <b1> in hex string
  Error (1734110): Illegal character <87> in hex string
  Error (1734111): Illegal character <af> in hex string
  Error (1734112): Illegal character <86> in hex string

Even PDFs made with xsane 0.995 would print these errors to the console in Evince. (Yet 0.995 scanned grayscale just fine.)

However, the non-mangled PDFs saved by xsane will load without error in GhostScript.

In GhostScript, the mangled PDFs error upon view and do not display. ("Error: /syntaxerror in ID" .... plus stack values)

This seems to only affect Grayscale PDF files generated with xsane; saving to PostScript, PNG, JPG work fine. Xsane PDFs have always been bloated. A single-page grayscale document weighs in around 1.5MB. Yet if I send that (unmangled) PDF through GhostScript, it reduces it to 100KB.

This is how I do the PDF conversion with GhostScript:
  gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=gs.pdf xsane.pdf

xsane version: 0.996-1ubuntu2
Scanner: Epson RX500

Misoldgit (simonrhart) wrote :

Having the same problem, but worse. I cant get Xsane to produce any sensible form of PDF whether the scan is single page or multipage, colour or grey. The same result is produced ie the corrupted page per the attachment to this bug. The colour scan produces a colour version with random coloured pixels.
I'm running Ubuntu 10.04.1 LTS and using Xsane 0.996

Steven Sciame (sasciame) wrote :

I switched to gNewsense. It is a 100% free( as in freedom) distro based on Ubuntu 8.04 LTS. Xsane works perfectly in that distro. So it looks like somewhere between 8.04 and Jaunty something got messed up.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xsane (Ubuntu):
status: New → Confirmed
Jonas T. (jo-t) wrote :

The bug still exists even in Oneiric (11.10) with XSane 0.998. Sadly, no one seems to care.

Jonas T. (jo-t) wrote :

Update: Scanning in color mode doesn't help either. Save to PDF is messed up anyway.

Jason Farenden (jcsoz) wrote :

Have you tried changing the bit depth from 16 bits to 8 - this worked for me - anything I try to scan to PDF (either colour or B&W) at 16 bits just gives me crap out!!

Changing the colour depth back to 8 bits and it seems to work!!

Good luck.

Adey (komorebi-e) wrote :

Thank you Jason, Ive just tested this with 2 multipage scans, one set to 16bit and the other at 8 bit. The 8 bit version of the files gave a valid colour PDF file.

Ubuntu 13.10 Saucy Salamander. not with the latest sane packages:

libsane:i386 1.0.23-0ubuntu3
libsane-common 1.0.23-0ubuntu3
sane-utils 1.0.23-0ubuntu3

Steven Sciame, thank you for reporting this and helping make Ubuntu better.

As per https://wiki.ubuntu.com/Releases your release is EOL.

If you have an issue in a supported release (ex. 16.04) please file a new report, and feel free to subscribe me to it.

Changed in xsane (Ubuntu):
status: Confirmed → Invalid
Jan Stephan (j-stephan) wrote :

This bug is still present on Ubuntu 19.10. I recently encountered it. It seems to be related to 16 bit output files, switching to 8 bit results in correctly scanned documents.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers