原創(chuàng)|其它|編輯:郝浩|2013-01-14 10:58:16.000|閱讀 279 次
概述:activePDF公司的的主打產(chǎn)品activePDF Toolkit通過(guò)簡(jiǎn)單的代碼設(shè)置,不僅實(shí)現(xiàn)圖片的轉(zhuǎn)換功能,將圖片轉(zhuǎn)換為PDF格式,還能將JPEG格式轉(zhuǎn)換為PDF。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
activePDF公司的的主打產(chǎn)品activePDF Toolkit通過(guò)簡(jiǎn)單的代碼設(shè)置,不僅實(shí)現(xiàn)圖片的轉(zhuǎn)換功能,將圖片轉(zhuǎn)換為PDF格式,還能將JPEG格式轉(zhuǎn)換為PDF。
示例代碼如下:
// Copyright (c) 2013 activePDF, Inc. // Example created 01/13/13 // Make sure to add the activePDF product .NET DLL(s) to your application. // .NET DLL(s) are typically found in the products 'bin' folder. class Examples { public void main() { string strPath; int intJPEGToPDF; int intTIFFToPDF; int intImageToPDF; strPath = AppDomain.CurrentDomain.BaseDirectory; // Instantiate Object APToolkitNET.Toolkit oTK = new APToolkitNET.Toolkit(); // Toolkit can directly convert an image to a PDF file // If the image is a JPEG file use JPEGToPDF intJPEGToPDF = oTK.JPEGToPDF(strPath + "IMG.jpg", strPath + "JPEG.pdf"); if (intJPEGToPDF < 1) { ErrorHandler("JPEGToPDF", intJPEGToPDF); } // If the image file is a TIFF file use TIFFToPDF intTIFFToPDF = oTK.TIFFToPDF(strPath + "IMG.tif", strPath + "TIFF.pdf"); if (intTIFFToPDF != 1) { ErrorHandler("TIFFToPDF", intTIFFToPDF); } // Any supported image file can be converted to PDF with ImageToPDF intImageToPDF = oTK.ImageToPDF(strPath + "IMG.jpg", strPath + "IMG.pdf"); if (intImageToPDF != 1) { ErrorHandler("ImageToPDF", intImageToPDF); } // Release Object oTK = null; // Process Complete System.Diagnostics.Debug.WriteLine("Done!"); } // Error Handling public static void ErrorHandler(string strMethod, object rtnCode) { System.Diagnostics.Debug.WriteLine(strMethod + " error: " + rtnCode.ToString()); } }
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)