![]() Terminate ( ) print ( "Done.The total number of PDF documents in the world is estimated to have crossed 3 trillion. Initialize (LicenseKey ) # Demonstrate Convert.ToPdf and Convert.PrinterĮrr = ConvertToPdfFromFile ( ) if err : print ( "ConvertFile failed" ) else : print ( "ConvertFile succeeded" ) # Demonstrate Convert.Įrr = ConvertSpecificFormats ( ) if err : print ( "ConvertSpecificFormats failed" ) else : print ( "ConvertSpecificFormats succeeded" ) The library is usually initialized only once, but calling # Initialize() multiple times is also fine. Ret = 1 print ( "ERROR: on input file " + inputFile ) return retĭef main ( ) : # The first step in every application using PDFNet is to initialize the # library. Close ( ) print ( "Converted file: " + inputFile + "\nto: " + outputFile ) except : Ret = 0 for testfile in testfiles : try : # convert from a file to PDF automatically def ConvertToPdfFromFile ( ) : e_remove_unused ) print ( "Saved svg2pdf.pdf" ) except : Save (outputPath + "svg2pdf.pdf", SDFDoc. FromSVG (pdfdoc, inputPath + "tiger.svg" ) ToTiff (inputPath + "newsletter.pdf", outputPath + "newsletter.tiff", tiff_options ) print ( "Saved newsletter.tiff" ) # Convert SVG file to PDF print ( "Converting SVG to PDF" )Ĭonvert. ToEpub (inputPath + "newsletter.pdf", outputPath + outputFile ) print ( "Saved " + outputFile ) print ( "Converting PDF to multipage TIFF" )Ĭonvert. ToHtml (inputPath + "newsletter.pdf", outputPath + outputFile ) print ( "Saved newsletter as HTML" ) # Convert PDF document to EPUB print ( "Converting PDF to EPUB" )Ĭonvert. ToXps (inputPath + "newsletter.pdf", outputPath + outputFile ) print ( "Saved " + outputFile ) # Convert PDF document to HTML print ( "Converting PDF to HTML" )Ĭonvert. ToXps (inputPath + "butterfly.png", outputPath +outputFile ) print ( "Saved " + outputFile ) # Convert PDF document to XPS print ( "Converting PDF to XPS" )Ĭonvert. ToSvg (pdfdoc, outputPath + outputFile ) print ( "Saved " + outputFile ) # Convert the PNG image to XPS print ( "Converting PNG to XPS" )Ĭonvert. Pdfdoc = PDFDoc (inputPath + "newsletter.pdf" ) print ( "Converting pdfdoc to SVG" )Ĭonvert. ![]() e_remove_unused ) print ( "Saved " + outputFile ) # Convert the two page PDF document to SVG S1 = inputPath + "simple-text.txt" print ( "Converting from txt" ) PutBool ( "UseSourceCodeFormatting", True ) e_remove_unused ) print ( "Saved " + outputFile ) # Convert the TXT document to PDF set = ObjSet ( ) S1 = inputPath + "simple-xps.xps" # Convert the XPS document to PDF print ( "Converting from XPS" ) Ret = 0 try : # Start with a PDFDoc to collect the converted documents OutputPath = "././TestFiles/Output/" def ConvertSpecificFormats ( ) : #- # Relative path to the folder containing the test files. # Please contact us if you have any questions. # Certain file formats such as XPS, EMF, PDF, and raster image formats can be directly # converted to PDF or XPS. The sample also shows how to convert MS Office files # using our built in conversion. append ( "././LicenseKey/PYTHON" ) from LicenseKey import * #- # The following sample illustrates how to use the PDF::Convert utility class to convert # documents and files to PDF, XPS, or SVG, or EMF. addsitedir ( "./././PDFNetC/Lib" ) import sysįrom PDFNetPython import * import platform ![]() # Consult LICENSE.txt regarding license information. #- # Copyright (c) 2001-2023 by Apryse Software Inc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |