Tiff to PDF with separator sheets

Discussions about image processing and document imaging.
Post Reply
rjskelton
Posts: 11
Joined: Mon Sep 14, 2009 10:25 pm

Tiff to PDF with separator sheets

Post by rjskelton » Fri Sep 18, 2009 11:13 pm

using gdpicture-activex-code-samples/scan-mul ... -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?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Tiff to PDF with separator sheets

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

Hi,

Please write the code you are using.

Kind regards,

Loïc

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

Re: Tiff to PDF with separator sheets

Post by 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.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Tiff to PDF with separator sheets

Post by 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()

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

Re: Tiff to PDF with separator sheets

Post by 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

Post by 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

Post by 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

Post by 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests