viewer current image id

Discussions about document viewing.
Post Reply
PQSIK
Posts: 50
Joined: Wed Oct 21, 2009 7:26 pm

viewer current image id

Post by PQSIK » Tue Apr 19, 2011 12:51 am

Hi there,

I'm adding a guid to a image tag like this and save the file as a MultiPage tiff below.

Code: Select all

Private Function AddImageToTiff(ByVal ThisFile As String) As Boolean
        Dim ImageID As Integer
        Try
            If Gdp.TiffIsEditableMultiPage(ThisTiffID) Then
                ImageID = Gdp.CreateGdPictureImageFromFile(ThisFile)
                Gdp.TagSetValueString(ImageID, Tags.TagDocumentName, TagType.TagTypeASCII, Guid.NewGuid.ToString.Replace("-", ""))
                Gdp.TiffAppendPageFromGdPictureImage(ThisTiffID, ImageID)
                Gdp.ReleaseGdPictureImage(ImageID)
                Return True
            End If
        Catch ex As Exception
            Gdp.ReleaseGdPictureImage(ImageID)
            Return False
        End Try
        Return True
    End Function
Now when I want to display in viewer I want to get the current page image and get the tag

I tried

Code: Select all

Gdp.TagGetValueString(ID, Tags.TagDocumentName)
but I'm not sure how to get the current image from the GdViewer1

GdViewer1.CurrentPage I think just returns the position not the imageid.

Can you show me how to get the selected image please.

pqsik

PQSIK
Posts: 50
Joined: Wed Oct 21, 2009 7:26 pm

Re: viewer current image id

Post by PQSIK » Tue Apr 19, 2011 2:22 am

I found the Tags.TagPageName and set the guid to that.

I had to loop thought and return the value, not sure why this way return Gdp.TagGetValueString(ThisTiffID, Tags.TagPageName) does not work.

Code: Select all

For nCpt = 1 To Gdp.TagCount(ThisTiffID)
                If Gdp.TagGetID(ThisTiffID, nCpt) = Tags.TagPageName Then
                    Return Gdp.TagGetValueString(ThisTiffID, nCpt)
                End If
            Next nCpt
Thanks

pqsik

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests