Loading...

Add a new scan to a multipage TIFF file

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Add a new scan to a multipage TIFF file

Postby drose » Tue Oct 28, 2008 7:59 pm

Hey Loic,

In my application, I have a scan create the multipage tif, add pages to it and close it.

However, I'd like to allow adding more pages to the same tif I created earlier. Is there a way to do this? I can't seem to only add to the multipage tif without overwriting what was originally in the file.

Thanks,

Derek
drose
 
Posts: 15
Joined: Mon Aug 11, 2008 8:05 pm

Re: Add a new scan to a multipage TIFF file

Postby MIKES » Tue Oct 28, 2008 10:33 pm

You will need to open the image with one ID as you are doing now.

When you scan, you will need to scan it to a new temporary ID.
Imaging1.TwainAcquireToGdPictureImage
_nImageID = Imaging1.GetNativeImage

Then after the scan put the two together with
Imaging1.TiffAppendPageFromGdPictureImage(nTiffOriginal, _nImageID)

When done scanning, need to make sure you close the temporary ID image.
Imaging1.CloseImage(_nImageID)

Set the oringinal Id as the native image.
Imaging1.SetNativeImage(nTiffOriginal)

Then save the image as you did the first time.

There are examples on the web that go over this, though sometimes you have to piece stuff together from more than one example.

This will append new scans to the end of an existing tiff.
If you want to get fancy and insert into the beginning or middle, you will have to to this same process and then reorder the pages after the append is done.

For more info on opening /saving the tiff, see the post from Tom M. here
howto-save-modified-tiff-file-t1047.html
Mike S.
GdPicturePro.Net v6.2.14
GdPicturePro5 v5.8.0
Vb.Net /Visual Studio 2005
MIKES
 
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

Re: Add a new scan to a multipage TIFF file

Postby drose » Wed Oct 29, 2008 9:08 pm

MIKES,

Thanks for the suggestion. However, I do not appear to have the TiffAppendPageFromGdPictureImage method. The only SDK I am using is the GdTwainPro 2 SDK (i.e., not the GdPicture Pro as Tom M. seems to use in his example).

Do you know of any other way using only GdTwainPro 2 SDK? I tried implementing your suggestions with some workarounds, but I am unable to get it to work as it keeps overwriting the previous scan.

You mentioned there were other examples on the web. If you can point me to those I would be glad to look myself and see if I can figure it out.
drose
 
Posts: 15
Joined: Mon Aug 11, 2008 8:05 pm

Re: Add a new scan to a multipage TIFF file

Postby MIKES » Thu Oct 30, 2008 1:47 am

Sorry did not realize that was the SDK you are using.

Loic will have to help.

Mike
Mike S.
GdPicturePro.Net v6.2.14
GdPicturePro5 v5.8.0
Vb.Net /Visual Studio 2005
MIKES
 
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

Re: Add a new scan to a multipage TIFF file

Postby Loïc » Thu Oct 30, 2008 11:37 am

Hi Derek,

Unfortunately it is impossible to edit existing multipage Tiff image using GdTwain [Pro]. See: http://www.gdpicture.com/sdk-comparison-matrix.php

I can exceptionally give you a free upgrade from GdTwain Pro to GdPicture Pro. Just send me your order number & license key at esales (at) gdpicture (dot) com.


Best 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


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: Google [Bot] and 1 guest