(inputPath & "newsletter.pdf", outputPath & "newsletter" )Ĭonsole.WriteLine ( "Saved newsletter as HTML" ) Catch e As PDFNetExceptionĬonsole.WriteLine ( "Converting PDF to EPUB" ) (inputPath & "newsletter.pdf", outputPath & "newsletter.xps" )Ĭonsole.WriteLine ( "Saved newsletter.xps" ) Catch e As PDFNetExceptionĬonsole.WriteLine ( "Converting PDF to HTML" ) ![]() (inputPath & "simple-word_2007.docx", outputPath & "simple-word_2007.xps" )Ĭonsole.WriteLine ( "Saved simple-word_2007.xps" ) Catch e As PDFNetExceptionĬonsole.WriteLine ( "Converting PDF to XPS" ) (inputPath & "butterfly.png", outputPath & "butterfly.xps" )Ĭonsole.WriteLine ( "Saved butterfly.xps" ) Catch e As PDFNetExceptionĮrr = True End Try If = PlatformID.Win32NT Then TryĬonsole.WriteLine ( "Converting DOCX to XPS" ) (pdfdoc, outputPath & "pdf2svg v2.svg" )Ĭonsole.WriteLine ( "Saved pdf2svg v2.svg" ) End Using Catch e As PDFNetExceptionĬonsole.WriteLine ( "Converting PNG to XPS" ) Pdfdoc.Save (outputPath & "simple-text.pdf", _remove_unused )Ĭonsole.WriteLine ( "Saved simple-text.pdf" ) End Using Catch e As PDFNetExceptionĮrr = True End Try Try Using pdfdoc As PDFDoc = New PDFDoc (inputPath & "newsletter.pdf" )Ĭonsole.WriteLine ( "Converting pdfdoc to SVG" ) (pdfdoc, inputPath & "simple-text.txt", options ) Options.PutBool ( "UseSourceCodeFormatting", True )Ĭonsole.WriteLine ( "Converting from txt" ) Pdfdoc.Save (outputPath & "emf2pdf v2.pdf", _remove_unused )Ĭonsole.WriteLine ( "Saved emf2pdf v2.pdf" ) End Using Catch e As PDFNetExceptionĮrr = True End Try End If Try Using pdfdoc As PDFDoc = New PDFDoc ( ) Dim As ObjSet = New ObjSet ( ) Dim options As Obj =. (pdfdoc, inputPath & "simple-emf.emf" ) Pdfdoc.Save (outputPath & "xps2pdf v2.pdf", _remove_unused )Ĭonsole.WriteLine ( "Saved xps2pdf v2.pdf" ) End Using Catch e As PDFNetExceptionĮrr = True End Try If = PlatformID.Win32NT Then Try Using pdfdoc As PDFDoc = New PDFDoc ( )Ĭonsole.WriteLine ( "Converting from EMF" ) (pdfdoc, inputPath & "simple-xps.xps" ) Shared pdfNetLoader As pdftron.PDFNetLoader = ( ) Shared Sub New ( ) End Sub Const inputPath As String = "././././TestFiles/" Const outputPath As String = "././././TestFiles/Output/" Private Shared Function ConvertSpecificFormats ( ) As Boolean Dim err As Boolean = False Try Using pdfdoc As PDFDoc = New PDFDoc ( )Ĭonsole.WriteLine ( "Converting from XPS" ) RequiresWindowsPlatform = requiresWindowsPlatform_ Public inputFile, outputFile As String Public requiresWindowsPlatform As Boolean Public Sub New ( ByVal inFile As String, ByVal outFile As String, ByVal requiresWindowsPlatform_ As Boolean ) Please see the following document for advice: ' Module ConvertTestVB ' ' Also note that conversion under ASP.NET can be tricky to configure. NET Framework running on Windows XP or Vista SP0 you need to install ' the XPS Essentials Pack (or equivalent redistributables). ' ' Note: the PDFNet printer is a virtual XPS printer supported on Vista SP1 and Windows 7, or. The manifest for this sample ' specifies appropriate the UAC elevation. ' The installing application must be run as administrator. To check ' if ToPDF (or ToXPS) require that PDFNet printer is installed use Convert::RequiresPrinter(filename). Other formats are converted using a virtual driver. ' ' Certain file formats such as XPS, EMF, PDF, and raster image formats can be directly ' converted to PDF or XPS. ' The following sample illustrates how to use the PDF::Convert utility class to convert ' documents and files to PDF, XPS, SVG, or EMF. ![]() ' ' Copyright (c) 2001-2021 by PDFTron Systems Inc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |