原創|其它|編輯:郝浩|2013-01-31 10:38:13.000|閱讀 237 次
概述:最新版本的activePDF Toolkit支持Flash文件轉換,它允許您在PDF報表中添加影片,動畫以及聲音。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
最新版本的activePDF Toolkit支持Flash文件轉換,它允許您在PDF報表中添加影片,動畫以及聲音。下面是嵌入Flash文件的代碼示例:
示例代碼如下:
// Copyright (c) 2013 activePDF, Inc. // Example created 01/29/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 intOpenOutputFile; int intOpenInputFile; int intCopyForm; strPath = AppDomain.CurrentDomain.BaseDirectory; // Instantiate Object APToolkitNET.Toolkit oTK = new APToolkitNET.Toolkit(); // Create the new PDF file intOpenOutputFile = oTK.OpenOutputFile(strPath + "new.pdf"); if (intOpenOutputFile != 0) { ErrorHandler("OpenOutputFile", intOpenOutputFile); } // Open the template PDF intOpenInputFile = oTK.OpenInputFile(strPath + "PDF.pdf"); if (intOpenInputFile != 0) { ErrorHandler("OpenInputFile", intOpenInputFile); } // Stamp a flash file onto the first page of the PDF oTK.EmbedFlashFile(strPath + "flash.swf", 396, 30, 144, 20, "", "", 0, "loop=0;playcommand=PV", 1); // Copy the template (with any changes) to the new file intCopyForm = oTK.CopyForm(0, 0); if (intCopyForm != 1) { ErrorHandler("CopyForm", intCopyForm); } // Close the new file to complete PDF creation oTK.CloseOutputFile(); // 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()); } }
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網