AppendPage's performance

Discussions about image processing and document imaging.
Post Reply
Eric
Posts: 12
Joined: Wed Oct 03, 2012 3:56 am

AppendPage's performance

Post by Eric » Fri Mar 29, 2013 12:53 pm

I have a multipage tiff file.

It's more than 1000 pages.

I use TiffAppendPageFromGdPictureImage method but it's too slow.

The simple code is below:

Dim docNo As String = String.Empty

For Each nmf As String In System.IO.Directory.GetFileSystemEntries(Me._noMatchDirectory, "*.tif")

Dim noMatchImageID As Integer = _oGdPictureImaging.TiffCreateMultiPageFromFile(nmf)

Dim ImageID As Integer = _oGdPictureImaging.TiffCreateMultiPageFromGdPictureImage(noMatchImageID)

docNo = _cf.GetDocNoByWithoutExtension(nmf, Me._noMatchDirectory)

Dim pages As Integer = _oGdPictureImaging.TiffGetPageCount(noMatchImageID)

For i As Integer = 1 To pages - 1

_oGdPictureImaging.TiffSelectPage(noMatchImageID, i + 1)

_oGdPictureImaging.TiffAppendPageFromGdPictureImage(ImageID, noMatchImageID)

Next

_oGdPictureImaging.ReleaseGdPictureImage(noMatchImageID)

Next

Is there a faster way to do it?

thanks~

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: AppendPage's performance

Post by SamiKharma » Sat Mar 30, 2013 3:39 pm

Hi,

Yes, there is a different faster way. You would need to use our functions for sequential tiff writing:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... od%29.html

Basically you create a new multipage file using TiffSaveAsMultiPageFile(), add the images you want using: TiffAddToMultiPageFile() then close the file using TiffCloseMultiPageFile().

Hope this helps.

Best of luck,
Sami

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest