GdPicture.NET使用教程:为PDF和TIFF添加XMP注释

原创|其它|编辑:郝浩|2012-12-12 16:52:52.000|阅读 404 次

概述:作为性价比最高的图像处理控件,GdPicture.NET的优势不仅仅是体现在对于图形进行扫描,并能将图像转换为PDF和TIFF格式文件,并进行处理,比如为PDF和TIFF文件添加XMP注释。

#慧都22周年庆大促·界面/图表报表/文档/IDE/IOT/测试等千款热门软控件火热促销中>>

相关链接:

作为性价比最高的图像处理控件,GdPicture.NET的优势不仅仅是体现在对于图形进行扫描,并能将图像转换为PDF和TIFF格式文件,并进行处理,比如为PDF和TIFF文件添加XMP注释。示例代码如下:

为PDF添加注释代码如下:

 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

 

2 为TIFF等图像添加注释:

 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

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP