原創(chuàng)|其它|編輯:郝浩|2012-12-17 16:33:37.000|閱讀 361 次
概述:GdPicture.NET不僅能很好的完成掃描任務(wù),還能進行一些列的處理,比如導(dǎo)出為PDF格式,并添加水印、數(shù)字化簽名、合并PDF文件等等,本文將給出在PDF文件中添加文本的示例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
作為圖形處理控件,GdPicture.NET不僅能良好的完成圖像掃描任務(wù),并在掃描之后的圖像處理上有著特定的優(yōu)勢,比如將掃描之后的圖像轉(zhuǎn)換為PDF格式,并做一系列的處理,比如添加水印、數(shù)字化簽名、合并PDF文件等等,在這篇GdPicture.NET的教程中,我們將以在PDF文件中添加文本為例,繼續(xù)探討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
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)