Loading...

Anotate Multipage Tiff Image

Discussions about image processing in GdPicture.NET using GdPictureImaging.

Anotate Multipage Tiff Image

Postby egw » Fri Jul 03, 2009 2:18 am

I have read through all the documentation and looked at all the sample code, but can not seem to figure out how to draw text to individual pages of a multipage tiff image. Any help would be appreciated.

Thanks
egw
 
Posts: 4
Joined: Fri Jul 03, 2009 2:10 am

Re: Anotate Multipage Tiff Image

Postby Loïc » Fri Jul 03, 2009 3:59 pm

Hi,

See this code sample into the reference guide:

http://guides.gdpicture.com/v5/gdpictur ... mFile.html

Kind regards,

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

Re: Anotate Multipage Tiff Image

Postby egw » Fri Jul 03, 2009 9:46 pm

Yes, I have looked at this code and there are a couple of issues. First and most important is that the DrawText method does not take the parameters you suggest in your example, it requries the ImageID as the first param. Second, when I create a multi page tiff from an existing multi page tiff that is not editable using TiffCreateMultiPageFromGdPictureImage(int ImageID) is should get an editable multi page tiff copy of the original, but I simply get a single empty page. Below is what I am attempting to accomplish.

Multi Page Tiff images are stored in SQL 2008 as BLOB Filestream.

Multi Page Tiff Image is opened into the Viewer using -

Byte[] arBytes = GetImageFromSQL(myDBImageID); //My Code
int ImageID = CreateGdPictureImageFromByteArray(ref Byte arBytes); //By checking TiffIsEditableMultiPage(ImageID) you see it is false

int pCount = TiffGetPageCount(ImageID ); //pCount is 17 as it should be

//Check multi page
if(TiffIsMultiPage(ImageID))
{
DisplayFromGdPictureImage(ImageID);
}

At this point the images is displayed in the Viewer with no problems. Viewer navigates to a particular page and some text is imputed.

int newImageID = TiffCreateMultiPageFromGdPictureImage(ImageID); //By checking TiffIsEditableMultiPage(newImageID) you see it is true.

However checking TiffGetPageCount(newImageID) you see it is 1.

Also the newImage is essentially blank or empty.

Thanks for your help.
egw
 
Posts: 4
Joined: Fri Jul 03, 2009 2:10 am

Re: Anotate Multipage Tiff Image

Postby Loïc » Sat Jul 04, 2009 12:26 pm

Hi,

I have a doubt: Are you talking about GdPicture.NET or GdPicture Pro Imaging SDK (ActiveX) ?

Here we are on the ActiveX section :wink:

Kind regards,

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

Re: Anotate Multipage Tiff Image

Postby egw » Sat Jul 04, 2009 11:13 pm

Sorry, I thought I had posted correctly, but I see I posted to the incorrect section. Can you move the post over or do I need to re-post?

Thanks
egw
 
Posts: 4
Joined: Fri Jul 03, 2009 2:10 am

Re: Anotate Multipage Tiff Image

Postby Loïc » Mon Jul 06, 2009 10:21 am

Therefore, see the dotnet sample from this link: http://guides.gdpicture.com/v6/html/con ... tring.html

Kind regards,

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

Re: Anotate Multipage Tiff Image

Postby egw » Tue Jul 07, 2009 10:53 pm

why does it increase the size of the file 10 fold? I tried ConvertTo1Bpp, but this makes little difference. Also it is extremely slow when running the example.
egw
 
Posts: 4
Joined: Fri Jul 03, 2009 2:10 am

Re: Anotate Multipage Tiff Image

Postby Loïc » Thu Jul 09, 2009 3:25 pm

Code: Select all
        Dim i As Integer
        Dim TiffImageID As Integer
        Dim PageCount As Integer
        Dim oGdPictureImaging As New GdPictureImaging

        oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a valid demo or commercial license key
        TiffImageID = oGdPictureImaging.TiffCreateMultiPageFromFile("input.tif")
        PageCount = oGdPictureImaging.TiffGetPageCount(TiffImageID)

        For i = 1 To PageCount
            Call oGdPictureImaging.TiffSelectPage(TiffImageID, i)
            Call oGdPictureImaging.DrawText(TiffImageID, "Page " & CStr(i) & " / " & CStr(PageCount), 50, 50, 10, FontStyle.FontStyleRegular, Color.Black, "Arial", True)
            oGdPictureImaging.ConvertTo1Bpp(TiffImageID) 'Comment this line to keep true color image
        Next i


        Call oGdPictureImaging.TiffSaveMultiPageToFile(TiffImageID, "output.tif", TiffCompression.TiffCompressionCCITT4)
        oGdPictureImaging.ReleaseGdPictureImage(TiffImageID)
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to Image Processing

Who is online

Users browsing this forum: No registered users and 1 guest