Add XMP Annotation by code to PDF/TIFF

Example requests & Code samples for GdPicture Toolkits.
Post Reply
Diego
Posts: 29
Joined: Thu Jan 19, 2012 9:09 pm

Add XMP Annotation by code to PDF/TIFF

Post by Diego » Thu Jan 19, 2012 9:25 pm

Hi,

Someone could help me and if possible I create / put entry in GdViewer class without having to use the method that has the
interactivity of the mouse? just add properties that I set up Direct.

Kind Regards

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

Re: Add mouse interactivity without annotation

Post by Loïc » Thu Jan 19, 2012 9:26 pm

Hi Diego,

Please could you clarify what you exactly want to do ?

Kind regards,

Loïc

Diego
Posts: 29
Joined: Thu Jan 19, 2012 9:09 pm

Re: Add mouse interactivity without annotation

Post by Diego » Thu Jan 19, 2012 9:31 pm

I want to create annotation directly into pdf or tif file without using the method GdViewer1.AddStickyNoteAnnotationInteractive ('Double click to change text', GdViewer1.ARGBI (255,0,0,0), 'Arial', 0, 12, 0.9,10); because this method is to use the mouse to specify where you want the note

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

Re: Add mouse interactivity without annotation

Post by Loïc » Fri Jan 20, 2012 1:02 pm

Hello Diego,

You have to use the AnnotationManager class for such purpose.

Example on adding annot by code to PDF:

Code: Select all

        Dim oGdPicturePDF As New GdPicturePDF

        If oGdPicturePDF.LoadFromFile("c:\test.pdf", False) = GdPictureStatus.OK Then
            Dim oAnnotationManager As AnnotationManager = New AnnotationManager
            If oAnnotationManager.InitFromGdPicturePDF(oGdPicturePDF) = GdPictureStatus.OK Then
                Dim annot As AnnotationStickyNote = oAnnotationManager.AddStickyNoteAnnot(0, 0, 3, 3, "To Be Investigated")
                annot.CanSelect = False
                annot.Author = "John"
                oAnnotationManager.BurnAnnotationsToPage(True) 'Comment this line to keep annots as XMP format
                oAnnotationManager.SaveDocumentToPDF("c:\testout.pdf")
                oAnnotationManager.Close()
            End If
            oGdPicturePDF.CloseDocument()
        End If
And here to image:

Code: Select all

        Dim oGdPictureImaging As New GdPictureImaging
        Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\001.tif")
        If oGdPictureImaging.GetStat = GdPictureStatus.OK Then
            Dim oAnnotationManager As AnnotationManager = New AnnotationManager
            If oAnnotationManager.InitFromGdPictureImage(ImageID) = GdPictureStatus.OK Then
                Dim annot As AnnotationStickyNote = oAnnotationManager.AddStickyNoteAnnot(0, 0, 3, 3, "To Be Investigated")
                annot.CanSelect = False
                annot.Author = "John"
                oAnnotationManager.BurnAnnotationsToPage(True) 'Comment this line to keep annots as XMP format
                oAnnotationManager.SaveDocumentToTIFF("c:\testout.tif", TiffCompression.TiffCompressionAUTO)
                oAnnotationManager.Close()
            End If
            oGdPictureImaging.ReleaseGdPictureImage(ImageID)
        End If

Diego
Posts: 29
Joined: Thu Jan 19, 2012 9:09 pm

Re: Add XMP Annotation by code to PDF/TIFF

Post by Diego » Fri Jan 20, 2012 6:49 pm

I am using the class GdViewer have a problem with last change above or has to be changed?

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

Re: Add XMP Annotation by code to PDF/TIFF

Post by Loïc » Fri Jan 20, 2012 6:51 pm

Hey Diego, I don't understand the question.

Diego
Posts: 29
Joined: Thu Jan 19, 2012 9:09 pm

Re: Add XMP Annotation by code to PDF/TIFF

Post by Diego » Fri Jan 20, 2012 8:22 pm

You use GdPicturePDF I use GdViewer has some problem? and how would you have passed this code in Delphi ?

Diego
Posts: 29
Joined: Thu Jan 19, 2012 9:09 pm

Re: Add XMP Annotation by code to PDF/TIFF

Post by Diego » Thu Jan 26, 2012 12:17 pm

You understand Loïc, help me ?

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

Re: Add XMP Annotation by code to PDF/TIFF

Post by SamiKharma » Thu Jan 26, 2012 12:34 pm

Hi,

If i understand you correctly you want to add annotations to the PDF file without that GdPicturePDF class because you do not have the PDF plugin. If that I understand you correctly then this is not possible, any PDF manipulation or addition is done through our PDF plugin.

If i misunderstood you, could you please explain exactly what you mean.

Best Regards,
Sami Kharma
GdPicture Support Team Member

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest