原創|其它|編輯:郝浩|2012-12-17 16:33:37.000|閱讀 361 次
概述:GdPicture.NET不僅能很好的完成掃描任務,還能進行一些列的處理,比如導出為PDF格式,并添加水印、數字化簽名、合并PDF文件等等,本文將給出在PDF文件中添加文本的示例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
作為圖形處理控件,GdPicture.NET不僅能良好的完成圖像掃描任務,并在掃描之后的圖像處理上有著特定的優勢,比如將掃描之后的圖像轉換為PDF格式,并做一系列的處理,比如添加水印、數字化簽名、合并PDF文件等等,在這篇GdPicture.NET的教程中,我們將以在PDF文件中添加文本為例,繼續探討GdPicture.NET的強大之處。
代碼示例如下:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim oGdPicturePDF As New GdPicturePDF oGdPicturePDF.SetLicenseNumber("XXX") 'Replace XXX by a valid demo or commercial key If oGdPicturePDF.LoadFromFile("c:\test.pdf", True) = GdPictureStatus.OK Then oGdPicturePDF.SelectPage(1) 'Selecting first page Dim font_res_name As String = oGdPicturePDF.AddTrueTypeFont("Arial", False, False, False) oGdPicturePDF.SetTextMode(PdfTextMode.PdfTextModeFill) oGdPicturePDF.SetTextSize(30) oGdPicturePDF.SetFillColor(255, 0, 0, 0) 'Using Cyan colour oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft) oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter) oGdPicturePDF.DrawText(font_res_name, 1, 1, "Hello World!") oGdPicturePDF.SaveToFileInc("c:\test.pdf") oGdPicturePDF.CloseDocument() MsgBox("Done") End If End Sub
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網