Loading...

Tiff to PDF with separator sheets

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Tiff to PDF with separator sheets

Postby rjskelton » Fri Sep 18, 2009 11:13 pm

using http://forums.gdpicture.com/gdpicture-activex-code-samples/scan-multiple-documents-once-using-separator-sheets-t480.html , I’m able to create PDFs files, but they save in PDF/A mode which is an issue. I’m trying to take a multipage tiff and create multiple PDF files using separator sheets. I have tried to mimic TwainPDFStart/Stop by using PDFNewPdf,PdfAddImageFromGdPictureImage, and PDFSavePdf methods, but I get a “invalid parameter” at the “Add” stage. Any suggestions?
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Re: Tiff to PDF with separator sheets

Postby Loïc » Sat Sep 19, 2009 11:46 am

Hi,

Please write the code you are using.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Tiff to PDF with separator sheets

Postby rjskelton » Mon Sep 21, 2009 5:54 pm

This is the simplest way to recreate the problem.

Code: Select all
        Dim nImageID As Long
       
        nImageID = AxImaging1.TiffCreateMultiPageFromFile("C:\Images\Able Test Dockets.tif")

        AxImaging1.PdfNewPdfEx("C:\Images\Test.pdf")
        AxImaging1.PdfAddImageFromGdPictureImage(nImageID)
        AxImaging1.PdfSavePdf()
        AxImaging1.TiffCloseNativeMultiPage()


The file is created but an error occurs when you open the file.
"There was an error opening this document. This file cannot be opened because it has no pages."
When the PdfSavePdf is executed the file size jumps to 12K.
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Re: Tiff to PDF with separator sheets

Postby Loïc » Mon Sep 21, 2009 6:00 pm

Hi,

You have to create a page then write your image on it:

Code: Select all
        Dim nImageID As Long
        Dim PdfImageIdx as Long
       
        nImageID = AxImaging1.TiffCreateMultiPageFromFile("C:\Images\Able Test Dockets.tif")

        AxImaging1.PdfNewPdfEx("C:\Images\Test.pdf")
        PdfImageIdx  = AxImaging1.PdfAddImageFromGdPictureImage(nImageID)
        AxImaging1.PdfSetPageDimensions(AxImaging1.PdfGetImageWidth(PdfImageId ), AxImaging1.PdfGetImagheight(PdfImageIdx))
       AxImaging1.PdfNewPage
       AxImaging1.PdfDrawImage(1, 1, 1, AxImaging1.PdfGetImageWidth(PdfImageIdx), AxImaging1.PdfGetImagheight(PdfImageIdx))
       AxImaging1.PdfEndPage
       AxImaging1.PdfSavePdf()
       AxImaging1.TiffCloseNativeMultiPage()
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Tiff to PDF with separator sheets

Postby rjskelton » Mon Sep 21, 2009 8:59 pm

Thank you
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Re: Tiff to PDF with separator sheets

Postby rjskelton » Mon Sep 21, 2009 10:38 pm

Can you please provide an example on how to create multiple documents from a multipage tiff? Each document is separated by a page that contains a barcode. The PDF cannot be a PDF/A. I would like to mimic TwainPDFStart and TwainPDFStop example, but save as a standard PDF.
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Re: Tiff to PDF with separator sheets

Postby rjskelton » Mon Sep 21, 2009 10:56 pm

Here is a better question, will a PDF/A file save as a PDF file?
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Re: Tiff to PDF with separator sheets

Postby rjskelton » Mon Sep 21, 2009 11:33 pm

I found out the answer, it is yes. You have to change the viewing mode in Acrobat > Preferences > Document. Then when you try to save, it will prompt to save as.
rjskelton
 
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest

cron