gscan2pdf generates blank pages in the .pdf output

Bug #204988 reported by Taylor Braun-Jones
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gscan2pdf (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: gscan2pdf

gscan2pdf-0.9.21 will some generate blank pdf pages where there should be a scanned page.

Steps to reproduce:

(1) Scan a few pages into gscan2pdf
(2) See that pages scanned in and looking good
(3) Now choose "Save as PDF" button
(4) Chose any form of compression other that "None"
(5) Open the generated PDF with evince or acroread and some pages may be blank

This is intermittent -- Sometimes I will scan the exact same pages and go through the same process over again and it will work.

Now that I have upgraded to 8.04 beta it seems to will always work when I choose Compression: "None". Before, with 7.04, it would never give blank pages with the "None" option, but sometimes the output from my black and white scan would be inverted (e.g. the page was black and the text was white)

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote : Re: [Bug 204988] [NEW] gscan2pdf generates blank pages in the .pdf output

On 22/03/2008, trjonescp <email address hidden> wrote:
> This is intermittent -- Sometimes I will scan the exact same pages and
> go through the same process over again and it will work.

Did this occur with 7.04 as well? I have never seen this, and I am using 7.10.

There have been issues with black/white reversal, but they were
reproducible, and due to a bug in imagemagick.

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

I'm sorry. I meant to say 7.10. I have never actually tried using gscan2pdf with Ubuntu 7.04.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote : Re: [Bug 204988] Re: gscan2pdf generates blank pages in the .pdf output

On 26/03/2008, trjonescp <email address hidden> wrote:
> I'm sorry. I meant to say 7.10. I have never actually tried using
> gscan2pdf with Ubuntu 7.04.

If you can reproduce this bug, I will do my best to fix it.

If you notice the problem, save the page in question in the format of
the compression, i.e. if you are using PNG compression, save the page
from gscan2pdf as PNG.

Restarting gscan2pdf, import the saved page and check that the
resulting PDF still has a blank page and attach the PNG (or whatever
it was) here.

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

Have same trouble here now with 8.04 updated to day.

Here are my findings:

When saving pdf document with png compression, blank pages.
When saving pdf document with lzw compression black pages.

However my finding is that this trouble is not due to the compression.
I have run several tests now, and they only occur when using the downsample option.

This is something that must have been broken latelly since I have used gscan2pdf all since 7.04 in both ubuntu and xubuntu.

Could you please check to make sure you have the trouble both with and without the downsample option when saving.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 27/03/2008, Tor Harald Thorland <email address hidden> wrote:
> I have run several tests now, and they only occur when using the downsample option.

OK. Now I have something to test. I generally don't use the downsample
option and therefore haven't seen the problem up to now.

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

I never use the downsample option, but I would guess the root problem is related to my issue.

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

OK, Just did several more scans now to be sure.

It a ll saves fine to pdf here with all types of compression (or without compression), just when I turn on the downsample it fails.
Lets see what Ratcliffe finds out and we split it in 2 separate bugs if needed.

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

Here is an example of a blank pdf out (all six pages) using PNG compression. When I chose compression None it worked fine.

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 28/03/2008, trjonescp <email address hidden> wrote:
> Here is an example of a blank pdf out (all six pages) using PNG
> compression. When I chose compression None it worked fine.

Please start gscan2pdf from the command line with

gscan2pdf --debug

and post the output from the command line when you save a PDF that
incorrectly has blank pages.

Posting blank results isn't so helpful - I believe you. If you can
post an image, that when imported, produces a blank PDF - that would
be very useful.

Importing a PNM (the format that libsane produces) and saving a PDF
with PNG compression works fine here. However, I do see an error
message (a dialog box appears) if I save the same with PNG compression
AND downsampling to 100dpi:

16-bits of rgb in png not supported. at
/usr/lib/perl5/site_perl/5.8.5/PDF/API2/Resource/XObject/Image/PNG.pm
line 132.

So I have something to work on.

Interestingly, importing a PNG that was scanned at 300dpi, saving as
PDF with compression=none, but downsampling to 100dpi looks OK in
Acrobat Reader, but not in Xpdf (blank black) or Kgshostview (blank
white).

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 28/03/2008, Jeffrey Ratcliffe <email address hidden> wrote:
> So I have something to work on.

I have a small patch that fixes both of the issues that I have seen.
If I attach a new .deb to this bug, would you mind installing it and
testing it for a couple of days to see if it sorts out the problems
without introducing any new ones.

If everything is OK, I will then get the fixed version uploaded to the
universe repository.

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

Go ahead, just attach it or send it private and I'll test.

I see you got the file you requested, so please advice if you need any other output.

Thanks a lot for this quick reply and fixes for this!!
Keep up the good work.

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

Jeffrey Ratcliffe wrote:
> I have a small patch that fixes both of the issues that I have seen.
> If I attach a new .deb to this bug, would you mind installing it and
> testing it for a couple of days to see if it sorts out the problems
> without introducing any new ones.
>
Yes, certainly. Thanks for the quick response (and sorry I wasn't able
to provide more information with the blank pdf output)

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 28/03/2008, Jeffrey Ratcliffe <email address hidden> wrote:
> I have a small patch that fixes both of the issues that I have seen.
> If I attach a new .deb to this bug, would you mind installing it and
> testing it for a couple of days to see if it sorts out the problems
> without introducing any new ones.
>
> If everything is OK, I will then get the fixed version uploaded to the
> universe repository.

Here it is. Please install it with

sudo dpkg -i gscan2pdf_0.9.21-1ubuntu4_all.deb

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

Hello,

Tried the following with the package attached to this bug.

Sacnned a page and saved it as follows:
1. without compression and without downsample
2. without compression and with downsample
3. with lzw comp. and downsample
4. with lzw comp. and without downsample
5. with png comp. and without downsample
6. with png comp. and with downsample

All the above test dis save as expected!

Thanks a lot.

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

Unfortunately, this did not seem to solve my blank page problem.

Here is the output from running 'gscan2pdf --debug' and doing

(1) Scan one page
(2) Save as pdf with png compression (produced a blank page output)
(3) Save as pdf with no compression (worked)

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 29/03/2008, trjonescp <email address hidden> wrote:
> Unfortunately, this did not seem to solve my blank page problem.
>
> Here is the output from running 'gscan2pdf --debug' and doing
>
> (1) Scan one page
> (2) Save as pdf with png compression (produced a blank page output)
> (3) Save as pdf with no compression (worked)

OK. Given you are both using 8.04, I'm slightly stumped about the
different behaviour. Please:

1. scan a page
2. save it as a PNM.
3. reimport the PNM and confirm that the PDF with PNG compression is blank.
4. post the PNM.
5. confirm the versions of
a. libpdf-api2-perl
b. imagemagick
that you have installed.

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

Hi,

-Scanned a page at binary 300dpi.
-Saved as pnm which gave me a 24mb file (to big to post.
-Closed and reopened the program
-opened the pnm file and saved it to pdf with lzw compression and downsampled it to 100dpi (the output quality sucks but it's working) see attachment.

5.a libpdf-api2-perl version: 0.68-1
5.b imagemagic version: 7:6.3.7.9.dfsg1-2ub

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

Well,

If you really want the file you can get it from my web page.
www.thorland.org/testscan_binary_300DPI.pnm

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 30/03/2008, Tor Harald Thorland <email address hidden> wrote:
> If you really want the file you can get it from my web page.
> www.thorland.org/testscan_binary_300DPI.pnm

I can import this and save it with PNG compression with no problem.
Just to confirm again that this produces a blank page with PNG
compression on your system?

Revision history for this message
Tor Harald Thorland (linux-strigen) wrote :

No, my system is the one that now works "perfect" after your last update.
I supplied the info so you could compare.
As you see here it worked fine:
https://bugs.launchpad.net/ubuntu/+source/gscan2pdf/+bug/204988/comments/14

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

Jeffrey Ratcliffe wrote:
> 1. scan a page
> 2. save it as a PNM.
> 3. reimport the PNM and confirm that the PDF with PNG compression is blank.
>
No, not blank. After testing several times, this works consistently.
> 4. post the PNM.
>
I can post a .pnm if you like, but using this approach works for me.
> 5. confirm the versions of
> a. libpdf-api2-perl
>
0.68-1
> b. imagemagick
>
7:6.3.7.9.dfsg1-2ubuntu1

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 01/04/2008, trjonescp <email address hidden> wrote:
> No, not blank. After testing several times, this works consistently.

Are you saying that whilst saving the PDF directly after scanning
produces blank pages, but saving as an image, and then reimporting it
doesn't? Or is the bug properly fixed?

Regards

Jeff

Revision history for this message
Taylor Braun-Jones (nocnokneo) wrote :

On Mon, Mar 31, 2008 at 10:08 PM, Jeffrey Ratcliffe
<<email address hidden> <mailto:<email address hidden>>> wrote:

    On 01/04/2008, trjonescp <<email address hidden>
    <mailto:<email address hidden>>> wrote:
     > No, not blank. After testing several times, this works consistently.

    Are you saying that whilst saving the PDF directly after scanning
    produces blank pages, but saving as an image, and then reimporting it
    doesn't?

Yes. Scan -> PDF does NOT work (intermittent), but Scan -> PNM ->
Import Image -> PDF DOES work (seems to be consistent).

I just realized that the --debug output I captured and posted earlier
was cut off, I guess because of forking that gscan2pdf does. I'll try
to just use copy/paste from a terminal window to capture all the output,
but right now I can't get the blank page error to happen.

Taylor

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On 02/04/2008, trjonescp <email address hidden> wrote:
> Yes. Scan -> PDF does NOT work (intermittent), but Scan -> PNM ->
> Import Image -> PDF DOES work (seems to be consistent).

This is problem on two fronts.

1. Internally, there is no difference between a scanned PNM and an imported PNM
2. More importantly, it makes it impossible for me to reproduce the problem.

> I just realized that the --debug output I captured and posted earlier
> was cut off, I guess because of forking that gscan2pdf does. I'll try
> to just use copy/paste from a terminal window to capture all the output,
> but right now I can't get the blank page error to happen.

I suggest that I get the patch uploaded, as it definitely sorts out
the other problem reported. Uploading the patch will close this bug.
Reopen it if you can reproduce the problem, and I'll look at it again.

Jeff

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :
Changed in gscan2pdf:
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gscan2pdf - 0.9.21-1ubuntu4

---------------
gscan2pdf (0.9.21-1ubuntu4) hardy; urgency=low

  * Force depth before embedding image in PDF
    LP: #204988 (gscan2pdf generates blank pages in the .pdf output)

 -- Jeffrey Ratcliffe <email address hidden> Fri, 28 Mar 2008 20:52:29 +0100

Changed in gscan2pdf:
status: Confirmed → Fix Released
Revision history for this message
Martin Thomas (martin-workersliberty) wrote :

I have the same problem with gscan2pdf 0.9.26 run under Kubuntu 8.04.

The scan looks all right, but saves as a blank page whatever option I chose for compression.

The only way I seem to be able to save output is to save the session, then go into the gzip file and extract a .pnm file. That can then be saved as png.

Importing the png and then saving also produces a blank page.

gscan2pdf --debug output attached.

Revision history for this message
Martin Thomas (martin-workersliberty) wrote :

Said to have been fixed in gscan2pdf 0.9.21, but seems still to be there, or to be there again, with gscan2pdf 0.9.26.

Changed in gscan2pdf:
status: Fix Released → Incomplete
Revision history for this message
Martin Thomas (martin-workersliberty) wrote :

The other weird thing is that when I use the save command, the programme appears to save, and a new pdf file is created on my machine - only it is just blank - but then, when I close gscan2pdf, I get a message saying: "Some pages have not been saved. Do you really want to quit?".

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

> The scan looks all right, but saves as a blank page whatever option I chose for compression.

In the --debug output, you scan a page, but do not save a PDF.

Excuse me if I am stating the obvious, but you realise that there are two set of options on the save dialog, firstly the file type - i.e. PNG, JPG, PDF, DjVu, etc., and if you select PDF, then you can select the compression type, i.e. LZW, PNG, JPG, etc.

> The only way I seem to be able to save output is to save the session,
> then go into the gzip file and extract a .pnm file. That can then be saved as png.

You should be able to save any page as PNG, JPG, TIFF etc. Does this not work?

> The other weird thing is that when I use the save command, the programme appears to save,
> and a new pdf file is created on my machine - only it is just blank - but then, when I close
> gscan2pdf, I get a message saying: "Some pages have not been saved. Do you really want to quit?".

This indicates that not all the pages have been marked as saved. Note that you can either save the selected pages or all pages.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

This bug report is still open. Is this still an issue for you guys with Karmic? Thanks

Revision history for this message
Pablo (pablixnm) wrote :

It started to happen to me in Karmic. Never happened before (at least since 8.04).
It gets stuck when saving a PDF or DJVU. I'm not downsampling images.
I'm using the HP5590. The scanner works fine although I miss the standard paper sizes in Scan Options.
Thanks!

Revision history for this message
Ben_H (bherzberg) wrote :

Just installed the application today. Using Karmic 64 bit and gscan2pdf off the repos - Save never ends. Progress bar shows up but never moves past the 1st page. This is when saving to PDF. Was able to correctly save to multipage TIFF. Using HP scanjet 3400C.

Thanks!

Revision history for this message
Jeffrey Ratcliffe (jeffreyratcliffe) wrote :

On Wed, Nov 25, 2009 at 09:52:45PM -0000, Ben_H wrote:
> Just installed the application today. Using Karmic 64 bit and gscan2pdf
> off the repos - Save never ends. Progress bar shows up but never moves
> past the 1st page. This is when saving to PDF. Was able to correctly
> save to multipage TIFF. Using HP scanjet 3400C.

That's a different bug. Please check out

https://bugs.launchpad.net/bugs/424249

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gscan2pdf (Ubuntu) because there has been no activity for 60 days.]

Changed in gscan2pdf (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.