Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Black PDF document

Last post 16 Nov 2008, 5:46 PM by witoldi. 4 replies.
Sort Posts: Previous Next
  •  11 Nov 2008, 6:18 PM 16553

    Black PDF document

    Hello

    I am evaluating DotImage 6.0 as a toolkit to build a simple scanning application. I need to scan a document and save it as a PDF. There is more in the application but the other details are not relevant...

    The toolkit works very well and I get the functionality that I need but I have run into a problem. I tested my prototype on three computers. On two I have no problem but on the third one the PDF file is not readable, it just shows with black body.

    Can anyone point to a solution? Maybe a missing file?

    Thanks

    Witold

     

  •  12 Nov 2008, 7:44 AM 16558 in reply to 16553

    Re: Black PDF document

    Can you open a support case with your code, the resulting PDF and any input images you have. I don't think there could be a deployment issue that would cause this (all code needed is in the assembly).

    Also, does it happen every time on that computer?  Is your PDF being created by the scanner driver or by our code (PdfEncoder).  If the PDF comes from the scanner driver, is the scanner the same on all computers? Is the driver version the same?

  •  12 Nov 2008, 8:08 PM 16567 in reply to 16558

    Re: Black PDF document

    Thanks for the reply.

    The PDF is created by the code. I pretty much used code similar to the examples provided with the toolkit:

    1. Used Device object to get the scanned image and load it into the DcoumentViewer:

    acqScanner is the Acquisition objects

     

       Device sel_device;

       .....

       sel_device.ModalAcquire = true;
       sel_device.Acquire();

     

            /*
             * The event ImageAcquired is raised when the image has been completely scanned
             */
            private void acqScanner_ImageAcquired(object sender, AcquireEventArgs e)
            {
                this.dvScannedDoc.Add(AtalaImage.FromBitmap(e.Image), "", "");

               ...
            }
     

     2. Use PdfEncoder to save the image to a PDF file:

       fileName is a string with a full path to the new pdf file

       ...

        this.dvScannedDoc.Save(fileName, new PdfEncoder());
        ...

    On a couple of computers the PDF file is created properly and it can be opened using Adobe Reader. On the third one it appears as a blank image.

    All three computers used different scanners. I run it successfully with Cannon CanoScan 4400F. Then I sent my prototype to someone else. They run it successfully on one PC and experienced the problem with blank PDF on another. I don't know all the details and I asked them to answer the questions about the scanner but I know that the scanners are different.


  •  13 Nov 2008, 7:44 AM 16573 in reply to 16567

    Re: Black PDF document

    Ok, for debugging purposes, change this line:

     this.dvScannedDoc.Add(AtalaImage.FromBitmap(e.Image), "", "");

     to this

       static int i = 0;
       AtalaImage img = AtalaImage.FromBitmap(e.Image);
       img.Save("file-"+ i +".png", new PngEncoder(), null);
       ++i;
       this.dvScannedDoc.Add(img, "", "");

     

    Then after scanning, look at the PNG files that got made.  Are they black -- if so, that's how they came from the scanner -- check your scanner driver, or tell us the exact model and scanner driver version that you had the problem with.  We may also send you diagnostic tools if this is the issue.

    If the images are not black, send them to us.  You can zip and attach to this case or if you need it to be private, open a support case.

  •  16 Nov 2008, 5:46 PM 16599 in reply to 16573

    Re: Black PDF document

    Thanks for the reply.

    I passed the info, and a link to this thread, to the developer who handles the computer with the problem. I asked them to reply to your post and add more details about the scanner.

View as RSS news feed in XML