原創|其它|編輯:郝浩|2012-12-13 16:00:59.000|閱讀 434 次
概述:使用GdPicture.NET控件,可以在現有的PDF文件中添加一張新的A4紙,并在這張新的PDF頁中畫圖。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
使用GdPicture.NET圖像處理控件控件,可以導出PDF文件并進行處理,比如可以在現有的PDF文件中添加一張新的A4紙,并在這張新的PDF頁中畫圖,代碼示例如下:
Dim oGdPicturePDF As New GdPicturePDF Dim oGdPictureImaging As New GdPictureImaging Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.tif") If ImageID > 0 AndAlso oGdPicturePDF.LoadFromFile("c:\test.pdf", True) = GdPictureStatus.OK Then 'Add the image as resource in the PDF document Dim image_res_name As String = oGdPicturePDF.AddImageFromGdPictureImage(ImageID, False, False) oGdPictureImaging.ReleaseGdPictureImage(ImageID) 'Insert a new blank A4 page as second page of the document. Dim pageWidth As Single = 8.27 Dim pageHeight As Single = 11.69 Dim pagePosition As Integer = 2 oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomLeft) oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch) oGdPicturePDF.InsertPage(pageWidth, pageHeight, pagePosition) oGdPicturePDF.SelectPage(pagePosition) 'Draw the image on the PDF page oGdPicturePDF.DrawImage(image_res_name, 0, 0, pageWidth, pageHeight) oGdPicturePDF.SaveToFileInc("c:\test.pdf") oGdPicturePDF.CloseDocument() End If
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網