By using Print2flash , you can easily convert your document into a real Adobe Flash format, with the best assurance that your content will actually be visible, and that it does not have an installation problem with the viewing tool compared to other formats.
There is a Interop.Print2Flash3.dll in Print2flash
Preparatory work:
1: Install Print2flashsetup.exe First and start the Windows service.
2: Make sure that the computer has Microsoft Office software installed.
3: Create the project and add reference Interop.Print2Flash3.dll, such as.
4: Also need to install Flash Player.
Write code:
The following code was validated successfully under the w732 system.
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading;usingSystem.IO;usingSystem.Collections;namespacepdftoswf{classProgram {Static voidMain (string[] args) {ArrayList alist=NewArrayList (); Alist. ADD ("temp_pdf.pdf"); Alist. ADD ("temp_ppt.ppt"); Alist. ADD ("temp_pptx.pptx"); Alist. ADD ("Temp_doc.doc"); Alist. ADD ("Temp_docx.docx"); Alist. ADD ("Temp_xls.xls"); Alist. ADD ("temp_xlsx.xlsx"); for(inti =0; I < Alist. Count; i++) { Try { stringPdffilepath =Alist[i]. ToString (); FileInfo Pdffi=NewFileInfo (Pdffilepath); stringfilepath =Pdffi.fullname; Console.WriteLine ("is transitioning"+ Pdffilepath +"file ..."); Print2falsh (filepath); } Catch(Exception ex) {Console.WriteLine ("Error:"+Ex. Message); }} console.readkey (); } Public Static stringPrint2falsh (stringsourceFileName) { stringURL =string. Empty; //generates a SWF file with the same file name under the current file directory. stringfilename =path.getfilenamewithoutextension (sourceFileName). ToLower (); stringImagedirectorypath =Path.getdirectoryname (sourceFileName); stringOutputFileName = Imagedirectorypath +"/"+ filename +". swf"; intInterfaceoptions = (int) (Print2flash3.interface_option. Intdrag | Print2flash3.interface_option. Intseltext |print2flash3.interface_option. Introtate| Print2flash3.interface_option. Intnewwind | Print2flash3.interface_option. Intbackbutton |print2flash3.interface_option. Intforwardbutton| Print2flash3.interface_option. Intfullscreen |print2flash3.interface_option. Intprint| Print2flash3.interface_option. Intsearchbox |print2flash3.interface_option. Intsearchbut| Print2flash3.interface_option. Intfitwidth |print2flash3.interface_option. Intfitpage| Print2flash3.interface_option. Intzoomslider |print2flash3.interface_option. Intzoombox| Print2flash3.interface_option. Intprevpage |print2flash3.interface_option. Intgotopage|print2flash3.interface_option. Intnextpage); Print2flash3.server2 P2fserver=NewPrint2flash3.server2 (); P2fServer.DefaultProfile.InterfaceOptions=interfaceoptions; P2fServer.DefaultProfile.ProtectionOptions= (int) print2flash3.protection_option. Protenapi; P2fserver.convertfile (sourceFileName, OutputFileName,NULL,NULL,NULL); URL=OutputFileName; returnURL; } }}
Get Source:
http://download.csdn.net/detail/luomingui/9170879
Using Print2flashsetup.exe documents to go to SWF