├── .gitattributes ├── .gitignore ├── CMakeLists.txt ├── Golang_Building_Guide.txt ├── LICENSE.txt ├── PDFNetC ├── .gitignore └── README.txt ├── PDFNetPHP ├── CMakeLists.txt ├── PDFNetPHP.i ├── PDFNetPHP.php ├── PDFNetUStringPHP.i └── PDFNet_StdStringPHP.i ├── PDFNetPython ├── CMakeLists.txt ├── PDFNetPython.i ├── PDFNetUStringPython2.i └── PDFNetUStringPython3.i ├── PDFNetRuby ├── CMakeLists.txt ├── PDFNetRuby.i └── PDFNetUStringRuby.i ├── PDFTronGo ├── CMakeLists.txt ├── README.md ├── build_go.py ├── ci │ └── windows │ │ ├── pdftron.go.replace │ │ ├── pdftron_wrap.cxx.replace │ │ └── pdftron_wrap.h.replace ├── go.mod ├── pdftron.i └── pdftron_ustring.i ├── PHP_Building_Guide_for_Windows.txt ├── README.md ├── README_RPATHS_MAC.md ├── Samples ├── AddImageTest │ ├── GO │ │ └── AddImage_test.go │ ├── PHP │ │ ├── AddImageTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── AddImageTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── AddImageTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── AdvancedImagingTest │ ├── GO │ │ └── AdvancedImaging_test.go │ ├── PHP │ │ ├── AdvancedImagingTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── AdvancedImagingTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── AdvancedImagingTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── AnnotationTest │ ├── GO │ │ └── Annotation_test.go │ ├── PHP │ │ ├── AnnotationTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── AnnotationTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── AnnotationTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── BarcodeTest │ ├── GO │ │ └── Barcode_test.go │ ├── PHP │ │ ├── BarcodeTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── BarcodeTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── BarcodeTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── BookmarkTest │ ├── GO │ │ └── Bookmark_test.go │ ├── PHP │ │ ├── BookmarkTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── BookmarkTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── BookmarkTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── CAD2PDFTest │ ├── GO │ │ └── CAD2PDF_test.go │ ├── PHP │ │ ├── CAD2PDFTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── CAD2PDFTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── CAD2PDFTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ContentReplacerTest │ ├── GO │ │ └── ContentReplacer_test.go │ ├── PHP │ │ ├── ContentReplacerTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ContentReplacerTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ContentReplacerTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ConvertPrintTest │ ├── GO │ │ └── ConvertPrint_test.go │ └── PYTHON │ │ ├── ConvertPrintTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ConvertTest │ ├── GO │ │ └── Convert_test.go │ ├── PHP │ │ ├── ConvertTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ConvertTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ConvertTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── DataExtractionTest │ ├── GO │ │ └── DataExtraction_test.go │ ├── PHP │ │ ├── DataExtractionTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── DataExtractionTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── DataExtractionTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── DigitalSignaturesTest │ ├── GO │ │ └── DigitalSignatures_test.go │ ├── PHP │ │ ├── DigitalSignaturesTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── DigitalSignaturesTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── DigitalSignaturesTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── DocumentCreationTest │ ├── PHP │ │ ├── DocumentCreationTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── DocumentCreationTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── DocumentCreationTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ElementBuilderTest │ ├── GO │ │ └── ElementBuilder_test.go │ ├── PHP │ │ ├── ElementBuilderTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ElementBuilderTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ElementBuilderTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ElementEditTest │ ├── GO │ │ └── ElementEdit_test.go │ ├── PHP │ │ ├── ElementEditTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ElementEditTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ElementEditTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ElementReaderAdvTest │ ├── GO │ │ └── ElementReaderAdv_test.go │ ├── PHP │ │ ├── ElementReaderAdvTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ElementReaderAdvTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ElementReaderAdvTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ElementReaderTest │ ├── GO │ │ └── ElementReader_test.go │ ├── PHP │ │ ├── ElementReaderTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ElementReaderTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ElementReaderTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── EncTest │ ├── GO │ │ └── Enc_test.go │ ├── PHP │ │ ├── EncTest.php │ │ ├── EncWebTest.php │ │ ├── EncWebTest2.php │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UsrInput.html │ ├── PYTHON │ │ ├── EncTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── EncTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── FDFTest │ ├── GO │ │ └── FDF_test.go │ ├── PHP │ │ ├── FDFTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── FDFTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── FDFTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── HTML2PDFTest │ ├── GO │ │ └── HTML2PDF_test.go │ ├── PHP │ │ ├── HTML2PDFTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── HTML2PDFTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── HTML2PDFTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ImageExtractTest │ ├── GO │ │ └── ImageExtract_test.go │ ├── PHP │ │ ├── ImageExtractTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ImageExtractTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ImageExtractTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── ImpositionTest │ ├── GO │ │ ├── Impositon_test.go │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PHP │ │ ├── ImpositionTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── ImpositionTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── ImpositionTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── InteractiveFormsTest │ ├── GO │ │ └── InteractiveForms_test.go │ ├── PHP │ │ ├── InteractiveFormsTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── InteractiveFormsTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── InteractiveFormsTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── JBIG2Test │ ├── GO │ │ └── JBIG2_test.go │ ├── PHP │ │ ├── JBIG2Test.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── JBIG2Test.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── JBIG2Test.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── LicenseKey │ ├── PHP │ │ └── LicenseKey.php │ ├── PYTHON │ │ └── LicenseKey.py │ └── RUBY │ │ └── LicenseKey.rb ├── LogicalStructureTest │ ├── GO │ │ └── LogicalStructure_test.go │ ├── PHP │ │ ├── LogicalStructureTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── LogicalStructureTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── LogicalStructureTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── OCRTest │ ├── GO │ │ └── OCR_test.go │ ├── PHP │ │ ├── OCRTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── OCRTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── OCRTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── OfficeTemplateTest │ ├── GO │ │ └── OfficeTemplate_test.go │ ├── PHP │ │ ├── OfficeTemplateTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── OfficeTemplateTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── OfficeTemplateTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── OfficeToPDFTest │ ├── GO │ │ └── OfficeToPDF_test.go │ ├── PHP │ │ ├── OfficeToPDFTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── OfficeToPDFTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── OfficeToPDFTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── OptimizerTest │ ├── GO │ │ └── Optimizer_test.go │ ├── PHP │ │ ├── OptimizerTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── OptimizerTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── OptimizerTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDF2HtmlTest │ ├── GO │ │ └── PDF2Html_test.go │ ├── PHP │ │ ├── PDF2HtmlTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDF2HtmlTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDF2HtmlTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDF2OfficeTest │ ├── GO │ │ └── PDF2Office_test.go │ ├── PHP │ │ ├── PDF2OfficeTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDF2OfficeTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDF2OfficeTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFATest │ ├── GO │ │ └── PDFA_test.go │ ├── PHP │ │ ├── PDFATest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFATest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFATest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFDocMemoryTest │ ├── GO │ │ └── PDFDocMemory_test.go │ ├── PHP │ │ ├── PDFDocMemoryTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFDocMemoryTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFDocMemoryTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFDrawTest │ ├── GO │ │ └── PDFDraw_test.go │ ├── PHP │ │ ├── PDFDrawTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFDrawTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFDrawTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFLayersTest │ ├── GO │ │ └── PDFLayers_test.go │ ├── PHP │ │ ├── PDFLayersTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFLayersTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFLayersTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFPackageTest │ ├── GO │ │ └── PDFPackage_test.go │ ├── PHP │ │ ├── PDFPackageTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFPackageTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFPackageTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFPageTest │ ├── GO │ │ └── PDFPage_test.go │ ├── PHP │ │ ├── PDFPageTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFPageTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFPageTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFPrintTest │ ├── GO │ │ └── PDFPrint_test.go │ ├── PHP │ │ ├── PDFPrintTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFPrintTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFPrintTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFRedactTest │ ├── GO │ │ └── PDFRedact_test.go │ ├── PHP │ │ ├── PDFRedactTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFRedactTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFRedactTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PDFUATest │ ├── GO │ │ └── PDFUA_test.go │ ├── PHP │ │ ├── PDFUATest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PDFUATest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PDFUATest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PageLabelsTest │ ├── GO │ │ └── PDFLabels_test.go │ ├── PHP │ │ ├── PageLabelsTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PageLabelsTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PageLabelsTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── PatternTest │ ├── GO │ │ └── Pattern_test.go │ ├── PHP │ │ ├── PatternTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── PatternTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── PatternTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── RectTest │ ├── GO │ │ └── Rect_test.go │ ├── PHP │ │ ├── RectTest.php │ │ ├── RunTest.bat │ │ └── RunTest.sh │ ├── PYTHON │ │ ├── RectTest.py │ │ ├── RunTest.bat │ │ └── RunTest.sh │ └── RUBY │ │ ├── RectTest.rb │ │ ├── RunTest.bat │ │ └── RunTest.sh ├── SDFTest │ ├── GO │ │ └── SDF_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── SDFTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── SDFTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── SDFTest.rb ├── StamperTest │ ├── GO │ │ └── Stamper_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── StamperTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── StamperTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── StamperTest.rb ├── TestFiles │ ├── BusinessCardTemplate.pdf │ ├── Electrical.rvt │ ├── Fishermen.docx │ ├── Font_licenses.txt │ ├── License.txt │ ├── Misc-Fixed.pfa │ ├── NotoSans_with_hindi.ttf │ ├── Output │ │ └── empty │ ├── SHA-2 Root USERTrust RSA CA Sectigo timestamping.crt │ ├── SYH_Letter.docx │ ├── Stadsslot Berlijn 2014.dwg │ ├── TigerText.pdf │ ├── US061222892-a.pdf │ ├── apryse.cer │ ├── apryse.pfx │ ├── autotag_input.pdf │ ├── butterfly.png │ ├── credit card numbers.pdf │ ├── dice.jpg │ ├── dice.u3d │ ├── doc_to_sign.pdf │ ├── factsheet_Arabic.docx │ ├── financial.pdf │ ├── fish.pdf │ ├── font.ttf │ ├── form1.pdf │ ├── form1_annots.xfdf │ ├── form1_data.fdf │ ├── form1_data.xfdf │ ├── formfields-scanned-withfields.pdf │ ├── formfields-scanned.pdf │ ├── formfields.pdf │ ├── grayscale.tif │ ├── hindi_sample_utf16be.txt │ ├── hindi_sample_utf16le.txt │ ├── imagemask.dat │ ├── logo_red.png │ ├── lorem_ipsum.pdf │ ├── multipage.tif │ ├── my_stream.txt │ ├── newsletter.pdf │ ├── newsletter.xod │ ├── numbered.pdf │ ├── op_blend_test.pdf │ ├── palm.jp2 │ ├── paragraphs_and_tables.pdf │ ├── pdfnet.gif │ ├── pdftron.bmp │ ├── pdftron_smart_substitution.plugin │ ├── peppers.jpg │ ├── signature.jpg │ ├── simple-emf.emf │ ├── simple-excel_2007.xlsx │ ├── simple-outlook.msg │ ├── simple-powerpoint_2007.pptx │ ├── simple-publisher.pub │ ├── simple-rtf.rtf │ ├── simple-text.txt │ ├── simple-visio.vsd │ ├── simple-webpage.html │ ├── simple-webpage.mht │ ├── simple-webpage_files │ │ ├── colorschememapping.xml │ │ ├── filelist.xml │ │ ├── image001.gif │ │ ├── image002.png │ │ ├── image003.jpg │ │ ├── image004.emz │ │ ├── image005.gif │ │ ├── image006.png │ │ ├── image007.gif │ │ ├── oledata.mso │ │ └── themedata.thmx │ ├── simple-word_2007.docx │ ├── simple-xps.xps │ ├── table.pdf │ ├── tagged.pdf │ ├── tagged_(en_to_fr).xlf │ ├── the_rime_of_the_ancient_mariner.docx │ ├── tiger.pdf │ ├── tiger.svg │ ├── waiver.pdf │ ├── waiver_withApprovalField.pdf │ ├── waiver_withApprovalField_certified.pdf │ ├── waiver_withApprovalField_certified_approved.pdf │ └── wrap_poly_demo.docx ├── TextExtractTest │ ├── GO │ │ └── TextExtract_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextExtractTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextExtractTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextExtractTest.rb ├── TextSearchTest │ ├── GO │ │ └── TextSearch_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextSearchTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextSearchTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TextSearchTest.rb ├── TransPDFTest │ ├── GO │ │ └── TransPDF_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TransPDFTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TransPDFTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── TransPDFTest.rb ├── U3DTest │ ├── GO │ │ └── U3D_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── U3DTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── U3DTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── U3DTest.rb ├── UndoRedoTest │ ├── GO │ │ └── UndoRedo_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UndoRedoTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UndoRedoTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UndoRedoTest.rb ├── UnicodeWriteTest │ ├── GO │ │ └── UnicodeWrite_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UnicodeWriteTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UnicodeWriteTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── UnicodeWriteTest.rb ├── WebViewerConvertTest │ ├── GO │ │ └── WebViewerConvert_test.go │ ├── PHP │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── WebViewerConvertTest.php │ ├── PYTHON │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── WebViewerConvertTest.py │ └── RUBY │ │ ├── RunTest.bat │ │ ├── RunTest.sh │ │ └── WebViewerConvertTest.rb ├── WebViewerStreamingTest │ ├── PHP │ │ ├── ConvertAndStream.php │ │ ├── ReadMe.txt │ │ └── WebViewer.html │ └── PYTHON │ │ ├── ConvertAndStream.py │ │ ├── ReadMe.txt │ │ ├── WebViewer.html │ │ ├── __init__.py │ │ ├── manage.py │ │ ├── settings.py │ │ └── urls.py ├── py_init.bat ├── py_init.sh ├── runall_go.bat ├── runall_go.sh ├── runall_php.bat ├── runall_php.sh ├── runall_python.bat ├── runall_python.sh ├── runall_ruby.bat └── runall_ruby.sh ├── fix_rpaths.sh └── jenkinsfiles ├── build_alpine_go.groovy ├── build_linux_arm_go.groovy ├── build_linux_go.groovy ├── build_mac_arm_go.groovy ├── build_mac_go.groovy └── build_win_go.groovy /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | 9 | # Declare files that will always have CRLF line endings on checkout. 10 | *.sln text eol=crlf 11 | 12 | # Declare files that will always have LF line endings on checkout. 13 | *.sh text eol=lf 14 | 15 | # Denote all files that are truly binary and should not be modified. 16 | *.png binary 17 | *.jpg binary 18 | *.pdf binary 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | Samples/TestFiles/Output 3 | CMakeFiles 4 | -------------------------------------------------------------------------------- /Golang_Building_Guide.txt: -------------------------------------------------------------------------------- 1 | This document shows a simple guide on how to build Golang bindings of PDFNet for Windows x64 and Linux x64. 2 | 3 | # Required Dependencies: 4 | - This repository 5 | - CMake: http://www.cmake.org/download/ (version 2.8+) 6 | - The correct PDFNetC64 for your build: https://www.pdftron.com/downloads/PDFNetC64.zip (Windows) 7 | - SWIG https://www.swig.org/download.html 8 | - Python3+ 9 | - Go 1.15+ 10 | 11 | ## Windows Only: 12 | - Download and install MINGW-64: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe 13 | 14 | # Build Instructions 15 | 16 | 1. Download the correct PDFNetC64 for your version from https://dev.apryse.com/nightly, place this in the root directory of this project and **ensure it is named according to the operating system**. 17 | 18 | Windows > PDFNetC64.zip 19 | Mac > PDFNetCMac.zip 20 | Linux > PDFNetC64.tar.gz 21 | 22 | 2. Open a terminal in the root directory and run `python PDFTronGo/build_go.py` 23 | 3. You should now have generated a project within ./build/PDFTronGo/pdftron. The build has completed. The project will be encapsulated within the 'pdftron' directory. 24 | 25 | # Testing 26 | 27 | 1. Add your Apryse License to ./build/PDFTronGo/pdftron/samples/runall_go.sh variable `LICENSE_KEY` 28 | 2. Run the tests via ./build/PDFTronGo/pdftron/samples/runall_go.sh (or .bat) 29 | 30 | You may run individual tests via ./build/PDFTronGo/pdftron/samples/runall_go.sh AddImageTest 31 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023, Apryse Software Incorporated. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | * Any derived software is used for sole purpose of interfacing with Apryse SDK. 6 | 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | * Neither the name of Apryse Software Incorporated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | 13 | -------------------------------------------------------------------------------- /PDFNetC/.gitignore: -------------------------------------------------------------------------------- 1 | PDFNetC 2 | PDFNetCMac 3 | PDFNetC64 4 | Headers 5 | Lib 6 | *.zip 7 | *.tar 8 | *.gz 9 | *.tar.gz 10 | -------------------------------------------------------------------------------- /PDFNetC/README.txt: -------------------------------------------------------------------------------- 1 | Place the Headers and Lib folder of PDFNetC here. 2 | -------------------------------------------------------------------------------- /PDFNetPHP/PDFNetPHP.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /PDFNetRuby/PDFNetUStringRuby.i: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------------------------------------------------- 2 | // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | // Consult LICENSE.txt for licensing information. 4 | //---------------------------------------------------------------------------------------------------------------------- 5 | 6 | /** 7 | * Typemap for UString from and to Ruby standard strings. 8 | */ 9 | 10 | %{ 11 | #include 12 | #include 13 | %} 14 | namespace pdftron { 15 | class UString; 16 | 17 | /** 18 | * Typemap between UString/const UString and Python string 19 | */ 20 | %typemap(in) UString, const UString 21 | { 22 | char* str = StringValuePtr($input); 23 | $1 = pdftron::UString(str); 24 | } 25 | 26 | %typemap(out) UString, const UString 27 | %{ 28 | /* int enc = rb_enc_find_index("UTF-8"); */ 29 | $result = rb_enc_associate_index(rb_str_new2($1.ConvertToUtf8().c_str()), rb_enc_find_index("UTF-8")); 30 | %} 31 | 32 | /** 33 | * Typemap between UString const & and Python string 34 | */ 35 | %typemap(in) UString const & 36 | { 37 | char* str = StringValuePtr($input); 38 | $1 = new pdftron::UString(str); 39 | } 40 | 41 | 42 | /** 43 | * directorout/directorin typemaps maps types for directors (C++ classes that can be extended/inherited in Python) 44 | */ 45 | /* UString -> Ruby string */ 46 | %typemap(directorin) UString, const UString 47 | { 48 | $1 = rb_enc_associate_index(rb_str_new2($input.ConvertToUtf8().c_str()), rb_enc_find_index("UTF-8")); 49 | } 50 | /* Ruby string -> UString */ 51 | %typemap(directorout) UString, const UString 52 | { 53 | char* str = StringValuePtr($1); 54 | $result = pdftron::UString(str); 55 | } 56 | 57 | /** 58 | * Checks the UStrings argument to ensure that the input is of the Unicode type. 59 | */ 60 | %typemap(typecheck,precedence=SWIG_TYPECHECK_UNISTRING) UString, const UString, UString const & 61 | %{ 62 | if (rb_type($input) == T_STRING) { 63 | $1 = 1; 64 | } 65 | else { 66 | $1 = 0; 67 | } 68 | %} 69 | 70 | /** 71 | * Clean up the allocated UString within the above typemaps 72 | */ 73 | %typemap(freearg) UString const & 74 | %{ 75 | if($1){ delete($1); $1 = 0; } 76 | %} 77 | } 78 | -------------------------------------------------------------------------------- /PDFTronGo/README.md: -------------------------------------------------------------------------------- 1 |
2 |

PDFTron GO

3 |

4 |

5 |

6 | Website 7 |

8 |
9 |
10 | 11 | # About 12 | 13 | This repository is for storing the completed artifacts for our Apryse SDK PDFTron-Go project at https://pkg.go.dev/github.com/pdftron/pdftron-go/v2 and managing releases. 14 | 15 | The code here is autogenerated from our PDFNetWrappers project and can be generated by following the directions available [here](https://github.com/ApryseSDK/PDFNetWrappers). 16 | 17 | # Supported platforms: Linux , Mac, Windows
18 | 19 | Required environments and versions:
20 | - Go 1.15 or greater
21 | - Git
22 | 23 | # Running PDFTron Go in your project 24 | 25 | Take a look at our documentation for more information on general usage. 26 | 27 | https://docs.apryse.com/core/guides/get-started/go/?platform=linux 28 | 29 | # Run PDFTron Go SDK in production 30 | 31 | A commercial license key is required for use in a production environment. Please contact us to purchase a commercial license if you do not have a valid license key. 32 | 33 | -------------------------------------------------------------------------------- /PDFTronGo/ci/windows/pdftron.go.replace: -------------------------------------------------------------------------------- 1 | / 2 | type _ sync.Mutex 3 | 4 | / 5 | type _ sync.Mutex 6 | 7 | 8 | //export Swiggo_pdftron_panic 9 | func Swiggo_pdftron_panic(message string) { 10 | panic(message) 11 | } 12 | / 13 | -------------------------------------------------------------------------------- /PDFTronGo/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/pdftron/pdftron-go/v2 2 | 3 | go 1.15 4 | -------------------------------------------------------------------------------- /PDFTronGo/pdftron_ustring.i: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------------------------------------------------- 2 | // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | // Consult LICENSE.txt for licensing information. 4 | //---------------------------------------------------------------------------------------------------------------------- 5 | 6 | /** 7 | * Typemap for UString from and to Go standard strings. 8 | */ 9 | 10 | %{ 11 | #include 12 | %} 13 | 14 | namespace pdftron { 15 | class UString; 16 | %typemap(gotype) UString, const UString, const UString & %{string%} 17 | 18 | /** 19 | * Typemap from Golang string to UString/const UString 20 | */ 21 | %typemap(in) UString, const UString 22 | %{ 23 | { 24 | std::string str; 25 | str.assign($input.p, $input.n); 26 | $1 = UString(str.c_str()); 27 | } 28 | %} 29 | 30 | /** 31 | * Typemap from Golang string to UString const & 32 | */ 33 | %typemap(in) UString const & 34 | %{ 35 | { 36 | std::string str; 37 | str.assign($input.p, $input.n); 38 | $1 = new UString(str.c_str()); 39 | } 40 | %} 41 | 42 | /** 43 | * Typemap from UString/const UString to Golang string 44 | */ 45 | %typemap(out) UString, const UString 46 | %{ 47 | { 48 | try { 49 | std::string str = $1.ConvertToUtf8(); 50 | _gostring_ ret; 51 | ret.p = (char*)malloc(str.length()); 52 | memcpy(ret.p, str.c_str(), str.length()); 53 | ret.n = str.length(); 54 | $result = ret; 55 | } catch (std::exception &e) { 56 | _swig_gopanic(e.what()); 57 | } 58 | } 59 | %} 60 | 61 | %typemap(out) const UString & 62 | %{ 63 | { 64 | // Wrapped functions are not catched by the general exception handler 65 | try { 66 | std::string str = $1->ConvertToUtf8(); 67 | _gostring_ ret; 68 | ret.p = (char*)malloc(str.length()); 69 | memcpy(ret.p, str.c_str(), str.length()); 70 | ret.n = str.length(); 71 | $result = ret; 72 | } catch (std::exception &e) { 73 | _swig_gopanic(e.what()); 74 | } 75 | } 76 | %} 77 | 78 | /** 79 | * Clean up the allocated UString within the above typemaps 80 | */ 81 | %typemap(freearg) UString const & 82 | %{ 83 | delete($1); 84 | %} 85 | 86 | %typemap(freearg) const char*& 87 | %{ 88 | free(*$1); 89 | %} 90 | 91 | /** 92 | * directorout typemaps maps types for directors (C++ classes that can be extended/inherited in Golang) 93 | */ 94 | 95 | /* Golang string -> UString */ 96 | %typemap(directorout) UString, const UString 97 | { 98 | { 99 | std::string str; 100 | str.assign($input.p, $input.n); 101 | $result = UString(str.c_str()); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /README_RPATHS_MAC.md: -------------------------------------------------------------------------------- 1 | # README FOR RPATH ISSUES ON MAC 2 | 3 | On newer versions of the Mac OS X operating system, there is a feature called "System Integrity Protection" which forbids dynamic loading from relative paths. In order to address this and yet allow you to move our libraries to a different path on your filesystem, we have provided a script that changes the LC_RPATH entries inside our libraries to the path at which the libraries are located. The script only works once after you download fresh libraries, so you will have to download unchanged libraries and run the script on them again whenever you want to move them to a different directory. 4 | 5 | ## I am unable to run the samples 6 | 7 | If you get one of these error messages, or similar: 8 | 9 | `dyld: warning, LC_RPATH . in /Users/Username/PDFNetWrappersMac/PDFNetC/Lib/PDFNetRuby.bundle being ignored in restricted program because it is a relative path` 10 | 11 | `dyld: warning, LC_RPATH . in /Users/Username/PDFNetWrappersMac/PDFNetC/Lib/_PDFNetPython.so being ignored in restricted program because it is a relative path` 12 | 13 | Then, the most likely problem is that your Mac OS X operating system has **System Integrity Protection** enabled, and the `LC_RPATH` of the PDFNet wrapper files need to be updated. 14 | 15 | ### Resolution 16 | ``` 17 | cd ./PDFNetC/Lib 18 | ./fix_rpaths.sh 19 | ``` 20 | 21 | ## I am trying to integrate PDFNet into my project 22 | 23 | If you get an error message similar to the ones above in your own project, the do the following **whenever you intend to move the library files to a different filesystem path:** 24 | 25 | 1. Download PDFNetC SDK again, or just extract again, so that you have *fresh* PDFNetC libraries. 26 | 2. Copy `fix_rpaths.sh` and the libraries you need (i.e. `libPDFNetC.dylib` and one or both of `_PDFNetPython.so`, `PDFNetRuby.bundle`) from `/PDFNetC/Lib` to the destination directory in your project. 27 | 3. Run `./fix_rpaths.sh` with the working directory set to the destination directory from step (2) above. 28 | -------------------------------------------------------------------------------- /Samples/AddImageTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AddImageTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AddImageTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AddImageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/AddImageTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=AddImageTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/AddImageTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AddImageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/AddImageTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AddImageTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AddImageTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AddImageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AdvancedImagingTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AdvancedImagingTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=AdvancedImagingTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AdvancedImagingTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AdvancedImagingTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AdvancedImagingTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AdvancedImagingTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AnnotationTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AnnotationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=AnnotationTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AnnotationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=AnnotationTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/AnnotationTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=AnnotationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=BarcodeTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BarcodeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=BarcodeTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BarcodeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=BarcodeTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/BarcodeTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BarcodeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | sudo ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=BookmarkTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BookmarkTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=BookmarkTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BookmarkTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=BookmarkTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/BookmarkTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=BookmarkTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/GO/CAD2PDF_test.go: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | // Consult LICENSE.txt regarding license information. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | package main 7 | import ( 8 | "fmt" 9 | "testing" 10 | "flag" 11 | . "github.com/pdftron/pdftron-go/v2" 12 | ) 13 | 14 | var licenseKey string 15 | var modulePath string 16 | 17 | func init() { 18 | flag.StringVar(&licenseKey, "license", "", "License key for Apryse SDK") 19 | flag.StringVar(&modulePath, "modulePath", "", "Path for downloaded modules") 20 | } 21 | 22 | // Relative path to the folder containing test files. 23 | var inputPath = "../TestFiles/CAD/" 24 | var outputPath = "../TestFiles/Output/" 25 | 26 | // --------------------------------------------------------------------------------------- 27 | // The following sample illustrates how to use CAD module 28 | // -------------------------------------------------------------------------------------- 29 | 30 | func TestCAD2PDF(t *testing.T){ 31 | 32 | // The first step in every application using PDFNet is to initialize the 33 | // library and set the path to common PDF resources. The library is usually 34 | // initialized only once, but calling Initialize() multiple times is also fine. 35 | PDFNetInitialize(licenseKey) 36 | 37 | // The location of the CAD Module 38 | PDFNetAddResourceSearchPath(modulePath) 39 | 40 | if ! CADModuleIsModuleAvailable(){ 41 | 42 | fmt.Println("Unable to run CAD2PDFTest: PDFTron SDK CAD module not available.\n" + 43 | "---------------------------------------------------------------\n" + 44 | "The CAD module is an optional add-on, available for download\n" + 45 | "at https://dev.apryse.com/. If you have already downloaded this\n" + 46 | "module, ensure that the SDK is able to find the required files\n" + 47 | "using the PDFNet::AddResourceSearchPath() function.") 48 | 49 | }else{ 50 | 51 | inputFileName := "construction drawings color-28.05.18.dwg" 52 | outputFileName := inputFileName + ".pdf" 53 | doc := NewPDFDoc() 54 | ConvertFromCAD(doc, inputPath + inputFileName) 55 | doc.Save(outputPath + outputFileName, uint(0)) 56 | } 57 | PDFNetTerminate() 58 | fmt.Println("CAD2PDF conversion example") 59 | } 60 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PHP/CAD2PDFTest.php: -------------------------------------------------------------------------------- 1 | Save($output_path."construction drawings color-28.05.18.dwg.pdf", 0); 38 | echo "CAD2PDF conversion example \n"; 39 | } 40 | PDFNet::Terminate(); 41 | ?> 42 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=CAD2PDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=CAD2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PYTHON/CAD2PDFTest.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | import site 7 | site.addsitedir("../../../PDFNetC/Lib") 8 | import sys 9 | from PDFNetPython import * 10 | 11 | sys.path.append("../../LicenseKey/PYTHON") 12 | from LicenseKey import * 13 | 14 | # Relative path to the folder containing test files. 15 | input_path = "../../TestFiles/CAD/" 16 | output_path = "../../TestFiles/Output/" 17 | 18 | # --------------------------------------------------------------------------------------- 19 | # The following sample illustrates how to use CAD module 20 | # -------------------------------------------------------------------------------------- 21 | 22 | def main(): 23 | 24 | # The first step in every application using PDFNet is to initialize the 25 | # library and set the path to common PDF resources. The library is usually 26 | # initialized only once, but calling Initialize() multiple times is also fine. 27 | PDFNet.Initialize(LicenseKey) 28 | 29 | # The location of the CAD Module 30 | PDFNet.AddResourceSearchPath("../../../PDFNetC/Lib/") 31 | 32 | if not CADModule.IsModuleAvailable(): 33 | 34 | print(""" 35 | Unable to run CAD2PDFTest: PDFTron SDK CAD module not available. 36 | --------------------------------------------------------------- 37 | The CAD module is an optional add-on, available for download 38 | at https://dev.apryse.com/. If you have already downloaded this 39 | module, ensure that the SDK is able to find the required files 40 | using the PDFNet::AddResourceSearchPath() function.""") 41 | 42 | else: 43 | 44 | inputFileName = "construction drawings color-28.05.18.dwg" 45 | outputFileName = inputFileName + ".pdf" 46 | doc = PDFDoc() 47 | Convert.FromCAD(doc, input_path + inputFileName, None) 48 | doc.Save(output_path + outputFileName, 0) 49 | 50 | PDFNet.Terminate() 51 | print("CAD2PDF conversion example") 52 | 53 | 54 | if __name__ == '__main__': 55 | main() -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=CAD2PDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=CAD2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/RUBY/CAD2PDFTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # Relative path to the folder containing test files. 13 | input_path = "../../TestFiles/CAD/" 14 | output_path = "../../TestFiles/Output/" 15 | 16 | #--------------------------------------------------------------------------------------- 17 | # The following sample illustrates how to use CAD module 18 | #--------------------------------------------------------------------------------------- 19 | 20 | # The first step in every application using PDFNet is to initialize the 21 | # library and set the path to common PDF resources. The library is usually 22 | # initialized only once, but calling Initialize multiple times is also fine. 23 | PDFNet.Initialize(PDFTronLicense.Key) 24 | 25 | # The location of the CAD Module 26 | PDFNet.AddResourceSearchPath("../../../PDFNetC/Lib/"); 27 | 28 | begin 29 | if !CADModule.IsModuleAvailable 30 | puts 'Unable to run CAD2PDFTest: PDFTron SDK CAD module not available.' 31 | puts '---------------------------------------------------------------' 32 | puts 'The CAD module is an optional add-on, available for download' 33 | puts 'at https://dev.apryse.com/. If you have already downloaded this' 34 | puts 'module, ensure that the SDK is able to find the required files' 35 | puts 'using the PDFNet::AddResourceSearchPath() function.' 36 | else 37 | inputFileName = "construction drawings color-28.05.18.dwg" 38 | outputFileName = inputFileName + ".pdf" 39 | doc = PDFDoc.new 40 | Convert.FromCAD(doc, input_path + inputFileName) 41 | doc.Save(output_path + outputFileName, 0) 42 | puts "CAD2PDF conversion example" 43 | doc.Close 44 | end 45 | rescue Exception=>e 46 | puts e 47 | 48 | end 49 | PDFNet.Terminate 50 | 51 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=CAD2PDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/CAD2PDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=CAD2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | sudo ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ContentReplacerTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ContentReplacerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/PYTHON/ContentReplacerTest.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | import site 7 | site.addsitedir("../../../PDFNetC/Lib") 8 | import sys 9 | from PDFNetPython import * 10 | 11 | sys.path.append("../../LicenseKey/PYTHON") 12 | from LicenseKey import * 13 | 14 | # Relattive path to the folder containing the test files. 15 | input_path = "../../TestFiles/" 16 | output_path = "../../TestFiles/Output/" 17 | 18 | #----------------------------------------------------------------------------------------- 19 | # The sample code illustrates how to use the ContentReplacer class to make using 20 | # 'template' pdf documents easier. 21 | #----------------------------------------------------------------------------------------- 22 | def main(): 23 | PDFNet.Initialize(LicenseKey) 24 | 25 | # Example 1) Update a business card template with personalized info 26 | 27 | doc = PDFDoc(input_path + "BusinessCardTemplate.pdf") 28 | doc.InitSecurityHandler() 29 | 30 | # first, replace the image on the first page 31 | replacer = ContentReplacer() 32 | page = doc.GetPage(1) 33 | img = Image.Create(doc.GetSDFDoc(), input_path + "peppers.jpg") 34 | replacer.AddImage(page.GetMediaBox(), img.GetSDFObj()) 35 | # next, replace the text place holders on the second page 36 | replacer.AddString("NAME", "John Smith") 37 | replacer.AddString("QUALIFICATIONS", "Philosophy Doctor") 38 | replacer.AddString("JOB_TITLE", "Software Developer") 39 | replacer.AddString("ADDRESS_LINE1", "#100 123 Software Rd") 40 | replacer.AddString("ADDRESS_LINE2", "Vancouver, BC") 41 | replacer.AddString("PHONE_OFFICE", "604-730-8989") 42 | replacer.AddString("PHONE_MOBILE", "604-765-4321") 43 | replacer.AddString("EMAIL", "info@pdftron.com") 44 | replacer.AddString("WEBSITE_URL", "http://www.pdftron.com") 45 | # finally, apply 46 | replacer.Process(page) 47 | 48 | doc.Save(output_path + "BusinessCard.pdf", SDFDoc.e_linearized) 49 | doc.Close() 50 | 51 | print("Done. Result saved in BusinessCard.pdf") 52 | 53 | # Example 2) Replace text in a region with new text 54 | 55 | doc = PDFDoc(input_path + "newsletter.pdf") 56 | doc.InitSecurityHandler() 57 | 58 | replacer = ContentReplacer() 59 | page = doc.GetPage(1) 60 | replacer.AddText(page.GetMediaBox(), "hello hello hello hello hello hello hello hello hello hello") 61 | replacer.Process(page) 62 | 63 | doc.Save(output_path + "ContentReplaced.pdf", SDFDoc.e_linearized) 64 | doc.Close() 65 | 66 | print("Done. Result saved in ContentReplaced.pdf") 67 | PDFNet.Terminate() 68 | print("Done.") 69 | 70 | if __name__ == '__main__': 71 | main() -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ContentReplacerTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ContentReplacerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ContentReplacerTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ContentReplacerTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ContentReplacerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ConvertPrintTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ConvertPrintTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ConvertPrintTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ConvertPrintTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/ConvertTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ConvertTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ConvertTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ConvertTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ConvertTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ConvertTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/ConvertTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ConvertTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ConvertTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/DataExtractionTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DataExtractionTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DataExtractionTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DataExtractionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/DataExtractionTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=DataExtractionTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/DataExtractionTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DataExtractionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/DataExtractionTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DataExtractionTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DataExtractionTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DataExtractionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DigitalSignaturesTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DigitalSignaturesTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=DigitalSignaturesTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DigitalSignaturesTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DigitalSignaturesTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DigitalSignaturesTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DigitalSignaturesTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DocumentCreationTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DocumentCreationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=DocumentCreationTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DocumentCreationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=DocumentCreationTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/DocumentCreationTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=DocumentCreationTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementBuilderTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementBuilderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ElementBuilderTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementBuilderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementBuilderTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementBuilderTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementBuilderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementEditTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementEditTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ElementEditTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementEditTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementEditTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementEditTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementEditTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementReaderAdvTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderAdvTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ElementReaderAdvTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderAdvTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementReaderAdvTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementReaderAdvTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderAdvTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/GO/ElementReader_test.go: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | // Consult LICENSE.txt regarding license information. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | package main 7 | import ( 8 | "fmt" 9 | "testing" 10 | "flag" 11 | . "github.com/pdftron/pdftron-go/v2" 12 | ) 13 | 14 | var licenseKey string 15 | var modulePath string 16 | 17 | func init() { 18 | flag.StringVar(&licenseKey, "license", "", "License key for Apryse SDK") 19 | flag.StringVar(&modulePath, "modulePath", "", "Module path for Apryse SDK") 20 | } 21 | 22 | // Relative path to the folder containing the test files. 23 | var inputPath = "../TestFiles/" 24 | 25 | func ProcessElements(reader ElementReader){ 26 | element := reader.Next() 27 | for element.GetMp_elem().Swigcptr() != 0{ // Read page contents 28 | if element.GetType() == ElementE_path{ // Process path data... 29 | //uncomment below if needed 30 | //data := element.GetPathData() 31 | //points := data.GetPoints() 32 | }else if element.GetType() == ElementE_text{ // Process text strings... 33 | data := element.GetTextString() 34 | fmt.Println(data) 35 | }else if element.GetType() == ElementE_form{ // Process form XObjects 36 | reader.FormBegin() 37 | ProcessElements(reader) 38 | reader.End() 39 | } 40 | element = reader.Next() 41 | } 42 | } 43 | 44 | func TestElementReader(t *testing.T){ 45 | PDFNetInitialize(licenseKey) 46 | 47 | // Extract text data from all pages in the document 48 | fmt.Println("-------------------------------------------------") 49 | fmt.Println("Sample 1 - Extract text data from all pages in the document.") 50 | fmt.Println("Opening the input pdf...") 51 | 52 | doc := NewPDFDoc(inputPath + "newsletter.pdf") 53 | doc.InitSecurityHandler() 54 | 55 | pageReader := NewElementReader() 56 | 57 | itr := doc.GetPageIterator() 58 | 59 | // Read every page 60 | for itr.HasNext(){ 61 | pageReader.Begin(itr.Current()) 62 | ProcessElements(pageReader) 63 | pageReader.End() 64 | itr.Next() 65 | } 66 | // Close the open document to free up document memory sooner. 67 | doc.Close() 68 | PDFNetTerminate() 69 | fmt.Println("Done.") 70 | } 71 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PHP/ElementReaderTest.php: -------------------------------------------------------------------------------- 1 | Next(); $element != null; $element = $reader->Next()) // Read page contents 16 | { 17 | switch ($element->GetType()) 18 | { 19 | case Element::e_path: // Process path data... 20 | { 21 | $data = $element->GetPathData(); 22 | $points = $data->GetPoints(); 23 | } 24 | break; 25 | case Element::e_text: // Process text strings... 26 | { 27 | $data = $element->GetTextString(); 28 | echo nl2br($data."\n"); 29 | } 30 | break; 31 | case Element::e_form: // Process form XObjects 32 | { 33 | $reader->FormBegin(); 34 | ProcessElements($reader); 35 | $reader->End(); 36 | } 37 | break; 38 | } 39 | } 40 | } 41 | 42 | PDFNet::Initialize($LicenseKey); 43 | PDFNet::GetSystemFontList(); // Wait for fonts to be loaded if they haven't already. This is done because PHP can run into errors when shutting down if font loading is still in progress. 44 | 45 | // Extract text data from all pages in the document 46 | 47 | echo nl2br("-------------------------------------------------\n"); 48 | echo nl2br("Sample 1 - Extract text data from all pages in the document.\n"); 49 | echo nl2br("Opening the input pdf...\n"); 50 | 51 | $doc = new PDFDoc($input_path."newsletter.pdf"); 52 | $doc->InitSecurityHandler(); 53 | 54 | $pgnum = $doc->GetPageCount(); 55 | 56 | $page_reader = new ElementReader(); 57 | 58 | for ($itr = $doc->GetPageIterator(); $itr->HasNext(); $itr->Next()) // Read every page 59 | { 60 | $page_reader->Begin($itr->Current()); 61 | ProcessElements($page_reader); 62 | $page_reader->End(); 63 | } 64 | PDFNet::Terminate(); 65 | echo nl2br("Done.\n"); 66 | ?> 67 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementReaderTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PYTHON/ElementReaderTest.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | import site 7 | site.addsitedir("../../../PDFNetC/Lib") 8 | import sys 9 | from PDFNetPython import * 10 | import unicodedata 11 | 12 | sys.path.append("../../LicenseKey/PYTHON") 13 | from LicenseKey import * 14 | 15 | # Relative path to the folder containing the test files. 16 | input_path = "../../TestFiles/" 17 | 18 | def ProcessElements(reader): 19 | element = reader.Next() 20 | while element != None: # Read page contents 21 | if element.GetType() == Element.e_path: # Process path data... 22 | data = element.GetPathData() 23 | points = data.GetPoints() 24 | elif element.GetType() == Element.e_text: # Process text strings... 25 | data = element.GetTextString() 26 | if sys.version_info.major == 2: 27 | reload(sys) 28 | sys.setdefaultencoding("utf-8") 29 | data = unicodedata.normalize('NFKC', unicode(data)).encode('ascii','replace') 30 | print(data) 31 | elif element.GetType() == Element.e_form: # Process form XObjects 32 | reader.FormBegin() 33 | ProcessElements(reader) 34 | reader.End() 35 | element = reader.Next() 36 | 37 | def main(): 38 | PDFNet.Initialize(LicenseKey) 39 | 40 | # Extract text data from all pages in the document 41 | print("-------------------------------------------------") 42 | print("Sample 1 - Extract text data from all pages in the document.") 43 | print("Opening the input pdf...") 44 | 45 | doc = PDFDoc(input_path + "newsletter.pdf") 46 | doc.InitSecurityHandler() 47 | 48 | page_reader = ElementReader() 49 | 50 | itr = doc.GetPageIterator() 51 | 52 | # Read every page 53 | while itr.HasNext(): 54 | page_reader.Begin(itr.Current()) 55 | ProcessElements(page_reader) 56 | page_reader.End() 57 | itr.Next() 58 | 59 | # Close the open document to free up document memory sooner. 60 | doc.Close() 61 | PDFNet.Terminate() 62 | print("Done.") 63 | 64 | if __name__ == '__main__': 65 | main() 66 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ElementReaderTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/ElementReaderTest/RUBY/ElementReaderTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # Relative path to the folder containing the test files. 13 | input_path = "../../TestFiles/" 14 | 15 | def ProcessElements(reader) 16 | element = reader.Next() 17 | while !element.nil? do # Read page contents 18 | if element.GetType() == Element::E_path # Process path data... 19 | data = element.GetPathData() 20 | points = data.GetPoints() 21 | elsif element.GetType() == Element::E_text # Process text strings... 22 | data = element.GetTextString() 23 | puts data 24 | elsif element.GetType() == Element::E_form # Process form XObjects 25 | reader.FormBegin() 26 | ProcessElements(reader) 27 | reader.End() 28 | end 29 | element = reader.Next() 30 | end 31 | end 32 | 33 | PDFNet.Initialize(PDFTronLicense.Key) 34 | 35 | # Extract text data from all pages in the document 36 | puts "-------------------------------------------------" 37 | puts "Sample 1 - Extract text data from all pages in the document." 38 | puts "Opening the input pdf..." 39 | 40 | doc = PDFDoc.new(input_path + "newsletter.pdf") 41 | doc.InitSecurityHandler() 42 | 43 | page_reader = ElementReader.new() 44 | 45 | itr = doc.GetPageIterator() 46 | 47 | # Read every page 48 | while itr.HasNext() do 49 | page_reader.Begin(itr.Current()) 50 | ProcessElements(page_reader) 51 | page_reader.End() 52 | itr.Next() 53 | end 54 | 55 | # Close the open document to free up document memory sooner. 56 | doc.Close() 57 | PDFNet.Terminate 58 | puts "Done." 59 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ElementReaderTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ElementReaderTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ElementReaderTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/EncTest/PHP/EncWebTest2.php: -------------------------------------------------------------------------------- 1 | InitStdSecurityHandler($password, strlen($password))) 23 | { 24 | $success = true; 25 | echo "The password is correct.\n"; 26 | } 27 | 28 | if(!$success) 29 | { 30 | echo "Document authentication error....\n"; 31 | return; 32 | } 33 | 34 | $hdlr = $doc->GetSecurityHandler(); 35 | echo nl2br("Document Open Password: ".$hdlr->IsUserPasswordRequired()."\n"); 36 | echo nl2br("Permissions Password: ".$hdlr->IsMasterPasswordRequired()."\n"); 37 | echo nl2br("Permissions: " 38 | ."\n\tHas 'owner' permissions: ".$hdlr->GetPermission(SecurityHandler::e_owner) 39 | ."\n\tOpen and decrypt the document: ".$hdlr->GetPermission(SecurityHandler::e_doc_open) 40 | ."\n\tAllow content extraction: ".$hdlr->GetPermission(SecurityHandler::e_extract_content) 41 | ."\n\tAllow full document editing: ".$hdlr->GetPermission(SecurityHandler::e_doc_modify) 42 | ."\n\tAllow printing: ".$hdlr->GetPermission(SecurityHandler::e_print) 43 | ."\n\tAllow high resolution printing: ".$hdlr->GetPermission(SecurityHandler::e_print_high) 44 | ."\n\tAllow annotation editing: ".$hdlr->GetPermission(SecurityHandler::e_mod_annot) 45 | ."\n\tAllow form fill: ".$hdlr->GetPermission(SecurityHandler::e_fill_forms) 46 | ."\n\tAllow content extraction for accessibility: ".$hdlr->GetPermission(SecurityHandler::e_access_support) 47 | ."\n\tAllow document assembly: ".$hdlr->GetPermission(SecurityHandler::e_assemble_doc) 48 | ."\n"); 49 | 50 | 51 | // remove all security on the document 52 | $doc->RemoveSecurity(); 53 | $doc->Save($output_path."not_secured.pdf", 0); 54 | $doc->Close(); 55 | PDFNet::Terminate(); 56 | echo "Test Completed.\n"; 57 | ?> 58 | -------------------------------------------------------------------------------- /Samples/EncTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=EncTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/EncTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=EncTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/EncTest/PHP/UsrInput.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | Password: 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Samples/EncTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=EncTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/EncTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=EncTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/EncTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=EncTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/EncTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=EncTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/FDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=FDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/FDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=FDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/FDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=FDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/FDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=FDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/FDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=FDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/FDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=FDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=HTML2PDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=HTML2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=HTML2PDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=HTML2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=HTML2PDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/HTML2PDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=HTML2PDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ImageExtractTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImageExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ImageExtractTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImageExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ImageExtractTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ImageExtractTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImageExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/GO/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not exist ..\..\bin\ ( 3 | md ..\..\bin\ >nul 4 | ) 5 | if not exist ..\..\bin\PDFNetC.dll ( 6 | copy ..\..\..\PDFNetC\Lib\PDFNetC.dll ..\..\bin\PDFNetC.dll >nul 7 | ) 8 | setlocal 9 | set TEST_NAME=ImpositionTest 10 | go build -o ../../bin/%TEST_NAME%.exe 11 | if %ERRORLEVEL% NEQ 0 goto EOF 12 | call ..\..\bin\%TEST_NAME%.exe 13 | :EOF 14 | endlocal 15 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/GO/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImpositionTest 3 | BIN_PATH="../../bin" 4 | 5 | if [ ! -d $BIN_PATH ] 6 | then 7 | mkdir -p $BIN_PATH 8 | fi 9 | 10 | go build -o $BIN_PATH/$TEST_NAME.exe 11 | 12 | if [ $? -eq 0 ] 13 | then 14 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../../PDFNetC/Lib 15 | $BIN_PATH/$TEST_NAME.exe 16 | fi 17 | 18 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ImpositionTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImpositionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=ImpositionTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImpositionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=ImpositionTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/ImpositionTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=ImpositionTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=InteractiveFormsTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=InteractiveFormsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=InteractiveFormsTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=InteractiveFormsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=InteractiveFormsTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/InteractiveFormsTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=InteractiveFormsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=JBIG2Test 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=JBIG2Test 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=JBIG2Test 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=JBIG2Test 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/RUBY/JBIG2Test.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # This sample project illustrates how to recompress bi-tonal images in an 13 | # existing PDF document using JBIG2 compression. The sample is not intended 14 | # to be a generic PDF optimization tool. 15 | # 16 | # You can download the entire document using the following link: 17 | # http://www.pdftron.com/net/samplecode/data/US061222892.pdf 18 | 19 | PDFNet.Initialize(PDFTronLicense.Key) 20 | 21 | pdf_doc = PDFDoc.new("../../TestFiles/US061222892-a.pdf") 22 | pdf_doc.InitSecurityHandler 23 | 24 | cos_doc = pdf_doc.GetSDFDoc 25 | num_objs = cos_doc.XRefSize 26 | 27 | i = 1 28 | while i < num_objs do 29 | obj = cos_doc.GetObj(i) 30 | if !obj.nil? and !obj.IsFree and obj.IsStream 31 | # Process only images 32 | itr = obj.Find("Subtype") 33 | if !itr.HasCurrent or !itr.Value.GetName == "Image" 34 | i = i + 1 35 | next 36 | end 37 | 38 | input_image = Image.new(obj) 39 | # Process only gray-scale images 40 | if input_image.GetComponentNum != 1 41 | i = i + 1 42 | next 43 | end 44 | 45 | # Skip images that are already compressed using JBIG2 46 | itr = obj.Find("Filter") 47 | if itr.HasCurrent and itr.Value.IsName and itr.Value.GetName == "JBIG2Decode" 48 | i = i + 1 49 | next 50 | end 51 | 52 | filter = obj.GetDecodedStream 53 | reader = FilterReader.new(filter) 54 | 55 | hint_set = ObjSet.new # hint to image encoder to use JBIG2 compression 56 | hint = hint_set.CreateArray 57 | 58 | hint.PushBackName("JBIG2") 59 | hint.PushBackName("Lossless") 60 | 61 | new_image = Image.Create(cos_doc, reader, 62 | input_image.GetImageWidth, 63 | input_image.GetImageHeight, 64 | 1, 65 | ColorSpace.CreateDeviceGray, 66 | hint) 67 | 68 | new_img_obj = new_image.GetSDFObj 69 | itr = obj.Find("Decode") 70 | 71 | if itr.HasCurrent 72 | new_img_obj.Put("Decode", itr.Value) 73 | end 74 | itr = obj.Find("ImageMask") 75 | if itr.HasCurrent 76 | new_img_obj.Put("ImageMask", itr.Value) 77 | end 78 | itr = obj.Find("Mask") 79 | if itr.HasCurrent 80 | new_img_obj.Put("Mask", itr.Value) 81 | end 82 | 83 | cos_doc.Swap(i, new_img_obj.GetObjNum) 84 | end 85 | i = i + 1 86 | end 87 | 88 | pdf_doc.Save("../../TestFiles/Output/US061222892_JBIG2.pdf", SDFDoc::E_remove_unused) 89 | pdf_doc.Close 90 | PDFNet.Terminate 91 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=JBIG2Test 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/JBIG2Test/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=JBIG2Test 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/LicenseKey/PHP/LicenseKey.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /Samples/LicenseKey/PYTHON/LicenseKey.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | # Enter your license key here. Please go to https://www.pdftron.com/pws/get-key to obtain a demo key or https://www.pdftron.com/form/contact-sales to obtain a production key. 7 | LicenseKey = "YOUR_PDFTRON_LICENSE_KEY" 8 | if LicenseKey == "YOUR_PDFTRON_LICENSE_KEY": 9 | raise Exception("Please enter your license key by replacing \"YOUR_PDFTRON_LICENSE_KEY\" that is assigned to the LicenseKey variable in Samples/LicenseKey/PYTHON/LicenseKey.py. If you do not have a license key, please go to https://www.pdftron.com/pws/get-key to obtain a demo license or https://www.pdftron.com/form/contact-sales to obtain a production key.") 10 | -------------------------------------------------------------------------------- /Samples/LicenseKey/RUBY/LicenseKey.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | class PDFTronLicense 7 | #Enter your key here. If you don't have it, please go to https://www.pdftron.com/pws/get-key to obtain a demo license or https://www.pdftron.com/form/contact-sales to obtain a production key. 8 | @key = "YOUR_PDFTRON_LICENSE_KEY" 9 | def self.Key 10 | if @key == "YOUR_PDFTRON_LICENSE_KEY" 11 | raise "Please enter your license key by replacing \"YOUR_PDFTRON_LICENSE_KEY\" that is assigned to the key variable in Samples/LicenseKey/RUBY/LicenseKey.rb. If you do not have a license key, please go to https://www.pdftron.com/pws/get-key to obtain a demo license or https://www.pdftron.com/form/contact-sales to obtain a production key." 12 | end 13 | @key 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=LogicalStructureTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=LogicalStructureTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=LogicalStructureTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=LogicalStructureTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=LogicalStructureTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/LogicalStructureTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=LogicalStructureTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/OCRTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OCRTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OCRTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OCRTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/OCRTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=OCRTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/OCRTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OCRTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/OCRTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OCRTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OCRTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OCRTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | sudo ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OfficeTemplateTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeTemplateTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=OfficeTemplateTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeTemplateTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OfficeTemplateTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OfficeTemplateTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeTemplateTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OfficeToPDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeToPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=OfficeToPDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeToPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OfficeToPDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OfficeToPDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OfficeToPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/OptimizerTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OptimizerTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OptimizerTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OptimizerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/OptimizerTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=OptimizerTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/OptimizerTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OptimizerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/OptimizerTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=OptimizerTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/OptimizerTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=OptimizerTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDF2HtmlTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2HtmlTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDF2HtmlTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2HtmlTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDF2HtmlTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDF2HtmlTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2HtmlTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDF2OfficeTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2OfficeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDF2OfficeTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2OfficeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDF2OfficeTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDF2OfficeTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDF2OfficeTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFATest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFATest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFATest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFATest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFATest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFATest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFATest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFATest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFATest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFDocMemoryTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDocMemoryTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFDocMemoryTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDocMemoryTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/RUBY/PDFDocMemoryTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # The following sample illustrates how to read/write a PDF document from/to 13 | # a memory buffer. This is useful for applications that work with dynamic PDF 14 | # documents that don't need to be saved/read from a disk. 15 | 16 | PDFNet.Initialize(PDFTronLicense.Key) 17 | 18 | # Relative path to the folder containing the test files. 19 | input_path = "../../TestFiles/" 20 | output_path = "../../TestFiles/Output/" 21 | 22 | # Read a PDF document in a memory buffer. 23 | file = MappedFile.new((input_path + "tiger.pdf")) 24 | file_sz = file.FileSize 25 | 26 | file_reader = FilterReader.new(file) 27 | 28 | mem = file_reader.Read(file_sz) 29 | doc = PDFDoc.new(mem, file_sz) 30 | doc.InitSecurityHandler 31 | num_pages = doc.GetPageCount 32 | 33 | writer = ElementWriter.new 34 | reader = ElementReader.new 35 | element = Element.new 36 | 37 | # Create a duplicate of every page but copy only path objects 38 | 39 | i = 1 40 | while i <= num_pages do 41 | itr = doc.GetPageIterator(2*i - 1) 42 | 43 | reader.Begin(itr.Current) 44 | new_page = doc.PageCreate(itr.Current.GetMediaBox) 45 | next_page = itr 46 | next_page.Next 47 | doc.PageInsert(next_page, new_page) 48 | 49 | writer.Begin(new_page) 50 | element = reader.Next 51 | while !element.nil? do # Read page contents 52 | #if element.GetType == Element::E_path 53 | writer.WriteElement(element) 54 | #end 55 | element = reader.Next 56 | end 57 | writer.End 58 | reader.End 59 | i = i + 1 60 | end 61 | 62 | doc.Save(output_path + "doc_memory_edit.pdf", SDFDoc::E_remove_unused) 63 | 64 | # Save the document to a memory buffer 65 | buffer = doc.Save(SDFDoc::E_remove_unused) 66 | 67 | # Write the contents of the buffer to the disk 68 | File.open(output_path + "doc_memory_edit.txt", 'w') { |file| file.write(buffer) } 69 | 70 | # Read some data from the file stored in memory 71 | reader.Begin(doc.GetPage(1)) 72 | element = reader.Next 73 | while !element.nil? do 74 | if element.GetType == Element::E_path 75 | print "Path, " 76 | end 77 | element = reader.Next 78 | end 79 | reader.End 80 | PDFNet.Terminate 81 | puts "\n\nDone. Result saved in doc_memory_edit.pdf and doc_memory_edit.txt ..." 82 | 83 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFDocMemoryTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFDocMemoryTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDocMemoryTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFDrawTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDrawTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFDrawTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDrawTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFDrawTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFDrawTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFDrawTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFLayersTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFLayersTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFLayersTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFLayersTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFLayersTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFLayersTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFLayersTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPackageTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPackageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFPackageTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPackageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPackageTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPackageTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPackageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPageTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFPageTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPageTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPageTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPageTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PHP/PDFPrintTest.php: -------------------------------------------------------------------------------- 1 | InitSecurityHandler(); 34 | 35 | // Set our PrinterMode options 36 | $printerMode = new PrinterMode(); 37 | $printerMode->SetCollation(true); 38 | $printerMode->SetCopyCount(1); 39 | $printerMode->SetDPI(600); // regardless of ordering, an explicit DPI setting overrides the OutputQuality setting 40 | $printerMode->SetDuplexing(PrinterMode::e_Duplex_Auto); 41 | 42 | // If the XPS print path is being used, then the printer spooler file will 43 | // ignore the grayscale option and be in full color 44 | $printerMode->SetOutputColor(PrinterMode::e_OutputColor_Grayscale); 45 | $printerMode->SetOutputQuality(PrinterMode::e_OutputQuality_Medium); 46 | // $printerMode->SetNUp(2,1); 47 | // $printerMode->SetScaleType(PrinterMode::e_ScaleType_FitToOutputPage); 48 | 49 | // Print the PDF document to the default printer, using "tiger.pdf" as the document 50 | // name, send the file to the printer not to an output file, print all pages, set the printerMode 51 | // and don't provide a cancel flag. 52 | PDFPrint::StartPrintJob($doc, "", $doc->GetFileName(), "", null, $printerMode, null); 53 | PDFNet::Terminate(); 54 | ?> 55 | 56 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPrintTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPrintTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PYTHON/PDFPrintTest.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | import site 7 | site.addsitedir("../../../PDFNetC/Lib") 8 | import sys 9 | from PDFNetPython import * 10 | 11 | sys.path.append("../../LicenseKey/PYTHON") 12 | from LicenseKey import * 13 | 14 | # The following sample illustrates how to print PDF document using currently selected 15 | # default printer. 16 | # 17 | # The first example uses the new PDF::Print::StartPrintJob function to send a rasterization 18 | # of the document with optimal compression to the printer. If the OS is Windows 7, then the 19 | # XPS print path will be used to preserve vector quality. For earlier Windows versions 20 | # the GDI print path will be used. On other operating systems this will be a no-op 21 | # 22 | # The second example uses PDFDraw send unoptimized rasterized data via awt.print API. 23 | # 24 | # If you would like to rasterize page at high resolutions (e.g. more than 600 DPI), you 25 | # should use PDFRasterizer or PDFNet vector output instead of PDFDraw. 26 | 27 | def main(): 28 | PDFNet.Initialize(LicenseKey) 29 | 30 | # Relative path to the folder containing the test files. 31 | input_path = "../../TestFiles/" 32 | 33 | doc = PDFDoc(input_path + "tiger.pdf") 34 | doc.InitSecurityHandler() 35 | 36 | # Set our PrinterMode options 37 | printerMode = PrinterMode() 38 | printerMode.SetCollation(True) 39 | printerMode.SetCopyCount(1) 40 | printerMode.SetDPI(100); # regardless of ordering, an explicit DPI setting overrides the OutputQuality setting 41 | printerMode.SetDuplexing(PrinterMode.e_Duplex_Auto) 42 | 43 | # If the XPS print path is being used, then the printer spooler file will 44 | # ignore the grayscale option and be in full color 45 | printerMode.SetOutputColor(PrinterMode.e_OutputColor_Grayscale) 46 | printerMode.SetOutputQuality(PrinterMode.e_OutputQuality_Medium) 47 | # printerMode.SetNUp(2,1) 48 | # printerMode.SetScaleType(PrinterMode.e_ScaleType_FitToOutPage) 49 | 50 | # Print the PDF document to the default printer, using "tiger.pdf" as the document 51 | # name, send the file to the printer not to an output file, print all pages, set the printerMode 52 | # and don't provide a cancel flag. 53 | Print.StartPrintJob(doc, "", doc.GetFileName(), "", None, printerMode, None) 54 | PDFNet.Terminate() 55 | 56 | if __name__ == '__main__': 57 | main() 58 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFPrintTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPrintTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/RUBY/PDFPrintTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # The following sample illustrates how to print PDF document using currently selected 13 | # default printer. 14 | # 15 | # The first example uses the new PDF::Print::StartPrintJob function to send a rasterization 16 | # of the document with optimal compression to the printer. If the OS is Windows 7, then the 17 | # XPS print path will be used to preserve vector quality. For earlier Windows versions 18 | # the GDI print path will be used. On other operating systems this will be a no-op 19 | # 20 | # The second example uses PDFDraw send unoptimized rasterized data via awt.print API. 21 | # 22 | # If you would like to rasterize page at high resolutions (e.g. more than 600 DPI), you 23 | # should use PDFRasterizer or PDFNet vector output instead of PDFDraw. 24 | 25 | if ENV['OS'] == 'Windows_NT' 26 | PDFNet.Initialize(PDFTronLicense.Key) 27 | 28 | # Relative path to the folder containing the test files. 29 | input_path = "../../TestFiles/" 30 | 31 | doc = PDFDoc.new(input_path + "tiger.pdf") 32 | doc.InitSecurityHandler 33 | 34 | # Set our PrinterMode options 35 | printerMode = PrinterMode.new 36 | printerMode.SetCollation(true) 37 | printerMode.SetCopyCount(1) 38 | printerMode.SetDPI(100) # regardless of ordering, an explicit DPI setting overrides the OutputQuality setting 39 | printerMode.SetDuplexing(PrinterMode::E_Duplex_Auto) 40 | 41 | # If the XPS print path is being used, then the printer spooler file will 42 | # ignore the grayscale option and be in full color 43 | printerMode.SetOutputColor(PrinterMode::E_OutputColor_Grayscale) 44 | printerMode.SetOutputQuality(PrinterMode::E_OutputQuality_Medium) 45 | # printerMode.SetNUp(2,1) 46 | # printerMode.SetScaleType(PrinterMode.e_ScaleType_FitToOutPage) 47 | 48 | # Print the PDF document to the default printer, using "tiger.pdf" as the document 49 | # name, send the file to the printer not to an output file, print all pages, set the printerMode 50 | # and don't provide a cancel flag. 51 | Print.StartPrintJob(doc, "", doc.GetFileName(), "", nil, printerMode, nil) 52 | PDFNet.Terminate 53 | puts "Done." 54 | else 55 | puts "This sample cannot be executed on this platform." 56 | end 57 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFPrintTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFPrintTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFPrintTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFRedactTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFRedactTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFRedactTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFRedactTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFRedactTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFRedactTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFRedactTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PDFUATest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFUATest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFUATest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFUATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PDFUATest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PDFUATest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PDFUATest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFUATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PDFUATest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PDFUATest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PDFUATest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PDFUATest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PageLabelsTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PageLabelsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PageLabelsTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PageLabelsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PageLabelsTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PageLabelsTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PageLabelsTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/PatternTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PatternTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PatternTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PatternTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/PatternTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=PatternTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/PatternTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PatternTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/PatternTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=PatternTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/PatternTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=PatternTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/RectTest/GO/Rect_test.go: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------------------- 2 | // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | // Consult LICENSE.txt regarding license information. 4 | //--------------------------------------------------------------------------------------- 5 | 6 | package main 7 | import ( 8 | "fmt" 9 | "testing" 10 | "flag" 11 | . "github.com/pdftron/pdftron-go/v2" 12 | ) 13 | 14 | var licenseKey string 15 | var modulePath string 16 | 17 | func init() { 18 | flag.StringVar(&licenseKey, "license", "", "License key for Apryse SDK") 19 | flag.StringVar(&modulePath, "modulePath", "", "Module path for Apryse SDK") 20 | } 21 | 22 | func TestRect(t *testing.T){ 23 | PDFNetInitialize(licenseKey) 24 | // Relative path to the folder containing test files. 25 | var inputPath = "../TestFiles/" 26 | var outputPath = "../TestFiles/Output/" 27 | // Test - Adjust the position of content within the page. 28 | fmt.Println("_______________________________________________") 29 | fmt.Println("Opening the input pdf...") 30 | 31 | inputDoc := NewPDFDoc(inputPath + "tiger.pdf") 32 | inputDoc.InitSecurityHandler() 33 | pgItr1 := inputDoc.GetPageIterator() 34 | 35 | mediaBox := NewRect(pgItr1.Current().GetMediaBox()) 36 | 37 | mediaBox.SetX1(mediaBox.GetX1() - 200) // translate the page 200 units (1 uint = 1/72 inch) 38 | mediaBox.SetX2(mediaBox.GetX2() - 200) 39 | 40 | mediaBox.Update() 41 | 42 | inputDoc.Save(outputPath + "tiger_shift.pdf", uint(0)) 43 | inputDoc.Close() 44 | 45 | PDFNetTerminate() 46 | fmt.Println("Done. Result saved in tiger_shift...") 47 | } 48 | -------------------------------------------------------------------------------- /Samples/RectTest/PHP/RectTest.php: -------------------------------------------------------------------------------- 1 | InitSecurityHandler(); 23 | $pg_itr1 = $input_doc->GetPageIterator(); 24 | 25 | $media_box = new Rect($pg_itr1->Current()->GetMediaBox()); 26 | 27 | $media_box->x1 -= 200; 28 | $media_box->x2 -= 200; 29 | 30 | $media_box->Update(); 31 | $input_doc->Save($output_path."tiger_shift.pdf", 0); 32 | $input_doc->Close(); 33 | PDFNet::Terminate(); 34 | echo nl2br("Done. Result saved in tiger_shift...\n"); 35 | ?> 36 | -------------------------------------------------------------------------------- /Samples/RectTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=RectTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/RectTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=RectTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/RectTest/PYTHON/RectTest.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | import site 7 | site.addsitedir("../../../PDFNetC/Lib") 8 | import sys 9 | from PDFNetPython import * 10 | 11 | sys.path.append("../../LicenseKey/PYTHON") 12 | from LicenseKey import * 13 | 14 | def main(): 15 | PDFNet.Initialize(LicenseKey) 16 | 17 | # Relative path to the folder containing the test files. 18 | input_path = "../../TestFiles/" 19 | output_path = "../../TestFiles/Output/" 20 | 21 | # Test - Adjust the position of content within the page. 22 | print("_______________________________________________") 23 | print("Opening the input pdf...") 24 | 25 | input_doc = PDFDoc(input_path + "tiger.pdf") 26 | input_doc.InitSecurityHandler() 27 | pg_itr1 = input_doc.GetPageIterator() 28 | 29 | media_box = Rect(pg_itr1.Current().GetMediaBox()) 30 | 31 | media_box.x1 -= 200 # translate the page 200 units (1 uint = 1/72 inch) 32 | media_box.x2 -= 200 33 | 34 | media_box.Update() 35 | 36 | input_doc.Save(output_path + "tiger_shift.pdf", 0) 37 | input_doc.Close() 38 | 39 | PDFNet.Terminate() 40 | print("Done. Result saved in tiger_shift...") 41 | 42 | if __name__ == '__main__': 43 | main() -------------------------------------------------------------------------------- /Samples/RectTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=RectTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/RectTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=RectTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/RectTest/RUBY/RectTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | PDFNet.Initialize(PDFTronLicense.Key) 13 | 14 | # Relative path to the folder containing the test files. 15 | input_path = "../../TestFiles/" 16 | output_path = "../../TestFiles/Output/" 17 | 18 | # Test - Adjust the position of content within the page. 19 | puts "_______________________________________________" 20 | puts "Opening the input pdf..." 21 | 22 | input_doc = PDFDoc.new(input_path + "tiger.pdf") 23 | input_doc.InitSecurityHandler 24 | pg_itr1 = input_doc.GetPageIterator 25 | 26 | media_box = Rect.new(pg_itr1.Current.GetMediaBox) 27 | 28 | media_box.x1 -= 200 # translate the page 200 units (1 uint = 1/72 inch) 29 | media_box.x2 -= 200 30 | 31 | media_box.Update 32 | 33 | input_doc.Save(output_path + "tiger_shift.pdf", 0) 34 | input_doc.Close 35 | PDFNet.Terminate 36 | puts "Done. Result saved in tiger_shift..." 37 | -------------------------------------------------------------------------------- /Samples/RectTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=RectTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/RectTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=RectTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/SDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=SDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/SDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=SDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/SDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=SDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/SDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=SDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/SDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=SDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/SDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=SDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/StamperTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=StamperTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/StamperTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=StamperTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/StamperTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=StamperTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/StamperTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=StamperTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/StamperTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=StamperTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/StamperTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=StamperTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/TestFiles/BusinessCardTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/BusinessCardTemplate.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/Electrical.rvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/Electrical.rvt -------------------------------------------------------------------------------- /Samples/TestFiles/Fishermen.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/Fishermen.docx -------------------------------------------------------------------------------- /Samples/TestFiles/License.txt: -------------------------------------------------------------------------------- 1 | butterfly.png: Photo by Didier Descouens. Distributed under the Creative Commons Attribution-ShareAlike 4.0 International license. see https://creativecommons.org/licenses/by-sa/4.0/deed.en 2 | -------------------------------------------------------------------------------- /Samples/TestFiles/NotoSans_with_hindi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/NotoSans_with_hindi.ttf -------------------------------------------------------------------------------- /Samples/TestFiles/Output/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Samples/TestFiles/SHA-2 Root USERTrust RSA CA Sectigo timestamping.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB 3 | iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl 4 | cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV 5 | BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw 6 | MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU 8 | aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy 9 | dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK 10 | AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B 11 | 3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY 12 | tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/ 13 | Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2 14 | VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT 15 | 79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6 16 | c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT 17 | Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l 18 | c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee 19 | UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE 20 | Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd 21 | BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G 22 | A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF 23 | Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO 24 | VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3 25 | ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs 26 | 8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR 27 | iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze 28 | Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ 29 | XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/ 30 | qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB 31 | VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB 32 | L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG 33 | jjxDah2nGN59PRbxYvnKkKj9 34 | -----END CERTIFICATE----- 35 | -------------------------------------------------------------------------------- /Samples/TestFiles/SYH_Letter.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/SYH_Letter.docx -------------------------------------------------------------------------------- /Samples/TestFiles/Stadsslot Berlijn 2014.dwg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/Stadsslot Berlijn 2014.dwg -------------------------------------------------------------------------------- /Samples/TestFiles/TigerText.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/TigerText.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/US061222892-a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/US061222892-a.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/apryse.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/apryse.cer -------------------------------------------------------------------------------- /Samples/TestFiles/apryse.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/apryse.pfx -------------------------------------------------------------------------------- /Samples/TestFiles/autotag_input.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/autotag_input.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/butterfly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/butterfly.png -------------------------------------------------------------------------------- /Samples/TestFiles/credit card numbers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/credit card numbers.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/dice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/dice.jpg -------------------------------------------------------------------------------- /Samples/TestFiles/dice.u3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/dice.u3d -------------------------------------------------------------------------------- /Samples/TestFiles/doc_to_sign.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/doc_to_sign.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/factsheet_Arabic.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/factsheet_Arabic.docx -------------------------------------------------------------------------------- /Samples/TestFiles/financial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/financial.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/fish.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/fish.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/font.ttf -------------------------------------------------------------------------------- /Samples/TestFiles/form1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/form1.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/form1_data.fdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/form1_data.fdf -------------------------------------------------------------------------------- /Samples/TestFiles/form1_data.xfdf: -------------------------------------------------------------------------------- 1 | 2 | YesYesOffOffYesYesJohn Smith454454543None34-4234 65th St Viova USA232234 Oak Bay St.3411 Peach St.1123Rockford Ruby43324324355343245542345324-35247777John 345344545Zoe -------------------------------------------------------------------------------- /Samples/TestFiles/formfields-scanned-withfields.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/formfields-scanned-withfields.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/formfields-scanned.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/formfields-scanned.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/formfields.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/formfields.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/grayscale.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/grayscale.tif -------------------------------------------------------------------------------- /Samples/TestFiles/hindi_sample_utf16be.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/hindi_sample_utf16be.txt -------------------------------------------------------------------------------- /Samples/TestFiles/hindi_sample_utf16le.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/hindi_sample_utf16le.txt -------------------------------------------------------------------------------- /Samples/TestFiles/imagemask.dat: -------------------------------------------------------------------------------- 1 | FFFFFFFFFFFFFFFFFFFFFFFCFFFFFFFF 2 | FFFFFFF87FFFFFFFFFFFFFF83FFFFFFF 3 | FFFFFFF83FFFFFFFFFFFFFF83FFFFFFF 4 | FFFFFFF83FFFFFFFEFFFFFF83FFFFFFF 5 | F3FFFFF83FFFFFFFF8FFFFF83FFFFFFF 6 | FE3FFFF83FFFFC7FFF0FFFF83FFFF87F 7 | FF87FFF83FFFE01FFFE1FFF87FFFC00F 8 | FFF0FFF87FFF0003FFF87FF87FFE007F 9 | FFFC3FF87FFC03FFFFFE0FF87FF80FFF 10 | FFFF07FC7FF03FFFFFFF83FC7FE0FFFF 11 | FFFFC1FC7FC1FFFFFFFFE0FC7F87FFFF 12 | FFFFF07C7F0FFFFFFFFFF87C7E1FFFFF 13 | FFFFFC3C7C7FFFFFFFFFFC1C7CFFFFFF 14 | FFFFFE0C78FFFFFFFFFFFF0C73FFFFFF 15 | FFFFFF8473FFFFFFFFFFFF8067FFFFFF 16 | FFFFFFC06FFFFFFFFFFFFFE04FFFFFFF 17 | FFFFFFF05FFFFFFFE00000000000000F 18 | E00000000000000FFFFFFFFC7FFFF80F 19 | FFFFFFFC7FFFFC1FFF7FFFFC7FFFFC3F 20 | FFBFFFFC7FFFFEFFFFDFFFFC7FFFFFFF 21 | FFCFFFFC7FFFFFFFFFE7FFFC7FFFFFFF 22 | FFE3FFFC7FFFFFFFFFF3FFFC7FFFFFFF 23 | FFF1FFFC7FFFFFFFFFF1FFFC7FFFFFFF 24 | FFF80000000003FFFFF80000000003FF 25 | FFFC7FFC7FFC07FFFFFC7FFC7FFE0FFF 26 | FFFC3FFC7FFF1FFFFFFE3FFC7FFFFFFF 27 | FFFE1FFC7FFFFFFFFFFE1FFC7FFFFFFF 28 | FFFE0FFC7FFFFFFFFFFE03F87FFFFFFF 29 | FFFF03F87FFFFFFFFFFF0FF83FFFFFFF 30 | FFFF7FF81FFFFFFFFFFFFFF81FFFFFFF 31 | FFFFFFF81FFFFFFFFFFFFFF3FFFFFFFF 32 | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 33 | -------------------------------------------------------------------------------- /Samples/TestFiles/logo_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/logo_red.png -------------------------------------------------------------------------------- /Samples/TestFiles/lorem_ipsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/lorem_ipsum.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/multipage.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/multipage.tif -------------------------------------------------------------------------------- /Samples/TestFiles/newsletter.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/newsletter.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/newsletter.xod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/newsletter.xod -------------------------------------------------------------------------------- /Samples/TestFiles/numbered.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/numbered.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/op_blend_test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/op_blend_test.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/palm.jp2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/palm.jp2 -------------------------------------------------------------------------------- /Samples/TestFiles/paragraphs_and_tables.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/paragraphs_and_tables.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/pdfnet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/pdfnet.gif -------------------------------------------------------------------------------- /Samples/TestFiles/pdftron.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/pdftron.bmp -------------------------------------------------------------------------------- /Samples/TestFiles/pdftron_smart_substitution.plugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/pdftron_smart_substitution.plugin -------------------------------------------------------------------------------- /Samples/TestFiles/peppers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/peppers.jpg -------------------------------------------------------------------------------- /Samples/TestFiles/signature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/signature.jpg -------------------------------------------------------------------------------- /Samples/TestFiles/simple-emf.emf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-emf.emf -------------------------------------------------------------------------------- /Samples/TestFiles/simple-excel_2007.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-excel_2007.xlsx -------------------------------------------------------------------------------- /Samples/TestFiles/simple-outlook.msg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-outlook.msg -------------------------------------------------------------------------------- /Samples/TestFiles/simple-powerpoint_2007.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-powerpoint_2007.pptx -------------------------------------------------------------------------------- /Samples/TestFiles/simple-publisher.pub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-publisher.pub -------------------------------------------------------------------------------- /Samples/TestFiles/simple-text.txt: -------------------------------------------------------------------------------- 1 | This is a simple ascii text file. It has long lines and explicit line breaks. 2 | 3 | http://www.fleurdelis.com/desiderata.htm 4 | 5 | Desiderata 6 | 7 | -- written by Max Ehrmann in the 1920s -- 8 | Not "Found in Old St. Paul's Church"! -- see the website above 9 | 10 | Go placidly amid the noise and the haste, 11 | and remember what peace there may be in silence. 12 | 13 | As far as possible, without surrender, 14 | be on good terms with all persons. 15 | Speak your truth quietly and clearly; 16 | and listen to others, 17 | even to the dull and the ignorant; 18 | they too have their story. 19 | Avoid loud and aggressive persons; 20 | they are vexatious to the spirit. 21 | 22 | If you compare yourself with others, 23 | you may become vain or bitter, 24 | for always there will be greater and lesser persons than yourself. 25 | Enjoy your achievements as well as your plans. 26 | Keep interested in your own career, however humble; 27 | it is a real possession in the changing fortunes of time. 28 | 29 | Exercise caution in your business affairs, 30 | for the world is full of trickery. 31 | But let this not blind you to what virtue there is; 32 | many persons strive for high ideals, 33 | and everywhere life is full of heroism. 34 | Be yourself. Especially do not feign affection. 35 | Neither be cynical about love, 36 | for in the face of all aridity and disenchantment, 37 | it is as perennial as the grass. 38 | 39 | Take kindly the counsel of the years, 40 | gracefully surrendering the things of youth. 41 | Nurture strength of spirit to shield you in sudden misfortune. 42 | But do not distress yourself with dark imaginings. 43 | Many fears are born of fatigue and loneliness. 44 | 45 | Beyond a wholesome discipline, 46 | be gentle with yourself. 47 | You are a child of the universe 48 | no less than the trees and the stars; 49 | you have a right to be here. 50 | And whether or not it is clear to you, 51 | no doubt the universe is unfolding as it should. 52 | 53 | Therefore be at peace with God, 54 | whatever you conceive Him to be. 55 | And whatever your labors and aspirations, 56 | in the noisy confusion of life, 57 | keep peace in your soul. 58 | 59 | With all its sham, drudgery, and broken dreams, 60 | it is still a beautiful world. 61 | Be cheerful. Strive to be happy. -------------------------------------------------------------------------------- /Samples/TestFiles/simple-visio.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-visio.vsd -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage.html -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage.mht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage.mht -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/colorschememapping.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/filelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image001.gif -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image002.png -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image003.jpg -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image004.emz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image004.emz -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image005.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image005.gif -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image006.png -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/image007.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/image007.gif -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/oledata.mso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/oledata.mso -------------------------------------------------------------------------------- /Samples/TestFiles/simple-webpage_files/themedata.thmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-webpage_files/themedata.thmx -------------------------------------------------------------------------------- /Samples/TestFiles/simple-word_2007.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-word_2007.docx -------------------------------------------------------------------------------- /Samples/TestFiles/simple-xps.xps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/simple-xps.xps -------------------------------------------------------------------------------- /Samples/TestFiles/table.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/table.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/tagged.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/tagged.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/the_rime_of_the_ancient_mariner.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/the_rime_of_the_ancient_mariner.docx -------------------------------------------------------------------------------- /Samples/TestFiles/tiger.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/tiger.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/waiver.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/waiver.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/waiver_withApprovalField.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/waiver_withApprovalField.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/waiver_withApprovalField_certified.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/waiver_withApprovalField_certified.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/waiver_withApprovalField_certified_approved.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/waiver_withApprovalField_certified_approved.pdf -------------------------------------------------------------------------------- /Samples/TestFiles/wrap_poly_demo.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/TestFiles/wrap_poly_demo.docx -------------------------------------------------------------------------------- /Samples/TextExtractTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TextExtractTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TextExtractTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/TextExtractTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=TextExtractTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/TextExtractTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py -------------------------------------------------------------------------------- /Samples/TextExtractTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TextExtractTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TextExtractTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextExtractTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TextSearchTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextSearchTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=TextSearchTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextSearchTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TextSearchTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TextSearchTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TextSearchTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TransPDFTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TransPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=TransPDFTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TransPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=TransPDFTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=TransPDFTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/TransPDFTest/RUBY/TransPDFTest.rb: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | require '../../../PDFNetC/Lib/PDFNetRuby' 7 | include PDFNetRuby 8 | require '../../LicenseKey/RUBY/LicenseKey' 9 | 10 | $stdout.sync = true 11 | 12 | # --------------------------------------------------------------------------------------- 13 | # The following sample illustrates how to extract xlf from a PDF document for translation. 14 | # It then applies a pre-prepared translated xlf file to the PDF to produce a translated PDF. 15 | # -------------------------------------------------------------------------------------- 16 | 17 | # Relative path to the folder containing test files. 18 | $input_path = "../../TestFiles/" 19 | $output_path = "../../TestFiles/Output/" 20 | 21 | def main() 22 | # The first step in every application using PDFNet is to initialize the 23 | # library and set the path to common PDF resources. The library is usually 24 | # initialized only once, but calling Initialize() multiple times is also fine. 25 | PDFNet.Initialize(PDFTronLicense.Key) 26 | 27 | begin 28 | 29 | # Open a PDF document to translate 30 | doc = PDFDoc.new($input_path + "tagged.pdf") 31 | options = TransPDFOptions.new 32 | 33 | # Set the source language in the options 34 | options.SetSourceLanguage("en") 35 | 36 | # Set the number of pages to process in each batch 37 | options.SetBatchSize(20) 38 | 39 | # Optionally, subset the pages to process 40 | # This PDF only has a single page, but you can specify a subset of pages like this 41 | # options.SetPages("-2,5-6,9,11-") 42 | 43 | # Extract the xlf to file and field the PDF for translation 44 | TransPDF.ExtractXLIFF(doc, $output_path + "tagged.xlf", options) 45 | 46 | # Save the fielded PDF 47 | doc.Save($output_path + "tagged-fielded.pdf", SDFDoc::E_linearized) 48 | 49 | # The extracted xlf can be translated in a system of your choice. 50 | # In this sample a pre-prepared translated file is used - tagged_(en_to_fr).xlf 51 | 52 | # Perform the translation using the pre-prepared translated xliff 53 | TransPDF.ApplyXLIFF(doc, $input_path + "tagged_(en_to_fr).xlf", options) 54 | 55 | # Save the translated PDF 56 | doc.Save($output_path + "tagged-fr.pdf", SDFDoc::E_linearized) 57 | doc.Close 58 | 59 | rescue => error 60 | puts "Unable to translate PDF document, error: " + error.message 61 | 62 | end 63 | 64 | PDFNet.Terminate 65 | puts "Done." 66 | end 67 | 68 | main() 69 | -------------------------------------------------------------------------------- /Samples/U3DTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=U3DTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/U3DTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=U3DTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/U3DTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=U3DTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/U3DTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=U3DTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/U3DTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=U3DTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/U3DTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=U3DTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=UndoRedoTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UndoRedoTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=UndoRedoTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UndoRedoTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=UndoRedoTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/UndoRedoTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UndoRedoTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=UnicodeWriteTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UnicodeWriteTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=UnicodeWriteTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UnicodeWriteTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=UnicodeWriteTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/UnicodeWriteTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=UnicodeWriteTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/PHP/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=WebViewerConvertTest 4 | set PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | php.exe %TEST_NAME%.php 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/PHP/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=WebViewerConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | php $TEST_NAME.php 5 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/PYTHON/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | call ..\..\py_init.bat 4 | if %ERRORLEVEL% NEQ 0 goto EOF 5 | set TEST_NAME=WebViewerConvertTest 6 | python.exe -u %TEST_NAME%.py 7 | :EOF 8 | endlocal 9 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/PYTHON/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=WebViewerConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | . ../../py_init.sh 5 | $python_exe -u $TEST_NAME.py 6 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/RUBY/RunTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set TEST_NAME=WebViewerConvertTest 4 | SET PATH=..\..\..\PDFNetC\Lib;%PATH% 5 | ruby.exe %TEST_NAME%.rb 6 | endlocal 7 | -------------------------------------------------------------------------------- /Samples/WebViewerConvertTest/RUBY/RunTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEST_NAME=WebViewerConvertTest 3 | export LD_LIBRARY_PATH=../../../PDFNetC/Lib 4 | ruby $TEST_NAME.rb 5 | -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PHP/ReadMe.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 2 | # Consult LICENSE.txt regarding license information. 3 | 4 | ConvertAndStream.php is a PHP web server script that will convert a source file to .xod, and stream it as the conversion is taking place. This example requires PHP capable web server (preferably Apache HTTP Server). 5 | 6 | 1. Install your choice of web server and make sure that it can parse and execute PHP scripts. 7 | 8 | 2. Set up your web server to use PDFNetC (see PHP_README.txt in PDFNetC package). 9 | 10 | 3. Copy the following files to their respective directories: 11 | a. Copy WebViewer.html to the root folder of htdocs (root folder where web serve will look for files). 12 | b. Copy PDFNetPHP.php (found in Lib folder of PDFNetC package) and ConvertAndStream.php to the root folder of htdocs. 13 | c. Download the WebViewer Redistributable (WebViewer.zip) from here: https://dev.apryse.com/ 14 | d. Extract the contents of WebViewer.zip to the root folder of htdocs (make sure you get the folder WebViewer/ inside htdocs root). 15 | 16 | 4. Modify ConvertAndStream.php so the paths to the files are absolute. Enable logging by setting the $LOG_ENABLED variable to true if desired. 17 | 18 | 5. Open your web browser and browse to: http://yourserver/WebViewer.html. Optionally, check the log file to see the results of sample. 19 | -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PYTHON/ConvertAndStream.py: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------------- 2 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 3 | # Consult LICENSE.txt regarding license information. 4 | #--------------------------------------------------------------------------------------- 5 | 6 | from django.http import HttpResponse 7 | from django.views.decorators.http import condition 8 | 9 | import os.path 10 | import site 11 | site.addsitedir("../../../PDFNetC/Lib") 12 | 13 | # because this sample must be ran on a Django framework, Python 3 modules are not supported. See: 14 | # https://docs.djangoproject.com/en/dev/faq/install/#can-i-use-django-with-python-3 15 | from PDFNetPython2 import PDFNet, Convert, XODOutputOptions, FilterReader 16 | 17 | # request handler as specified in the site's URLconf. 18 | @condition(etag_func=None) 19 | def convert_and_stream(request): 20 | 21 | # path where files are located. This relative to where Django root site is located. 22 | FILE_DIR = "../../TestFiles/"; 23 | 24 | getParams = request.GET 25 | fileName = 'newsletter.pdf' 26 | if getParams.__contains__('file'): 27 | fileName = getParams['file'] 28 | 29 | # check if file exists 30 | if not os.path.isfile(FILE_DIR + fileName): 31 | print 'File not found: "' + FILE_DIR + fileName + '"' 32 | return HttpResponse('

404 Not Found


File "' + fileName + '" cannot be found.', status=404) 33 | 34 | print 'Converting and streaming file: "' + FILE_DIR + fileName + '"...' 35 | 36 | try: 37 | return HttpResponse(perform_convert_and_stream(FILE_DIR + fileName), status=200, content_type='application/vnd.ms-xpsdocument', mimetype='application/vnd.ms-xpsdocument') 38 | except: 39 | return HttpResponse('

500 Internal Server Error

', status=500) 40 | 41 | def perform_convert_and_stream(filePath): 42 | PDFNet.Initialize() 43 | # set the conversion option to not create thumbnails on XOD files because 44 | # they will not be streamed back to the client. 45 | xodOptions = XODOutputOptions() 46 | xodOptions.SetOutputThumbnails(False) 47 | 48 | filter = Convert.ToXod(filePath, xodOptions) 49 | fReader = FilterReader(filter) 50 | 51 | BUFFER_SIZE = 64 * 1024 52 | totalBytes = 0 53 | 54 | print 'Start streaming...' 55 | buf = str(fReader.Read(BUFFER_SIZE)) 56 | while len(buf) > 0: 57 | totalBytes = totalBytes + len(buf) 58 | yield buf 59 | print 'Sent total: ' + str(totalBytes) + ' bytes' 60 | buf = str(fReader.Read(BUFFER_SIZE)) 61 | print 'Done.' 62 | -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PYTHON/ReadMe.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved. 2 | # Consult LICENSE.txt regarding license information. 3 | 4 | ConvertAndStream.py is a Python Django script that will convert a source file to .xod, and stream it as the conversion is taking place. This example requires Python and Django to be installed. 5 | 6 | 1. Download Django from http://www.djangoproject.com and install it. 7 | 8 | 2. Download the WebViewer Redistributable (WebViewer.zip) from here: https://dev.apryse.com/ 9 | 10 | 3. Extract the contents of WebViewer.zip to Samples/WebViewerStreaming/PYTHON (make sure you get the directory: Samples/WebViewerStreaming/PYTHON/WebViewer after extraction). 11 | 12 | 4. Copy Samples/TestFiles/newsletter.xod to Samples/WebViewerStreaming/PYTHON (this document is used in the sample by default). 13 | 14 | 5. Open a terminal (or command prompt in Windows) and navigate to Samples/WebViewerStreaming/PYTHON directory within the extracted PDFNetC archive. 15 | 16 | 6. Start the Django server on the pre-configured Django website (Samples/WebViewerStreaming/PYTHON): 17 | python manage.py runserver 0.0.0.0:8080 (may require sudo or UAC privileges) 18 | 19 | 7. Open your web browser then go to http://localhost:8080/WebViewer.html. Optionally, check the terminal output to see the results of sample. 20 | 21 | NOTE: This sample website project have most of the Django middlewares disabled. This is due to some middlewares require the response body to be fully prepared before the it is sent to then 22 | client (i.e. GzipMiddleware requires the full response body to be written before compressing it). This essentially breaks the streaming aspect of the sample project. For this sample project, 23 | all middlewares are disabled except for CommonMiddleware (see settings.py). 24 | -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PYTHON/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApryseSDK/PDFNetWrappers/f87dfc00d7d1791993f12a25c1b720a3fef396d8/Samples/WebViewerStreamingTest/PYTHON/__init__.py -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PYTHON/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from django.core.management import execute_manager 3 | import imp 4 | try: 5 | imp.find_module('settings') # Assumed to be in the same directory. 6 | except ImportError: 7 | import sys 8 | sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) 9 | sys.exit(1) 10 | 11 | import settings 12 | 13 | if __name__ == "__main__": 14 | execute_manager(settings) 15 | -------------------------------------------------------------------------------- /Samples/WebViewerStreamingTest/PYTHON/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import patterns, include, url 2 | 3 | # Uncomment the next two lines to enable the admin: 4 | # from django.contrib import admin 5 | # admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Examples: 9 | # url(r'^$', 'DjangoSite.views.home', name='home'), 10 | # url(r'^DjangoSite/', include('DjangoSite.foo.urls')), 11 | 12 | # Uncomment the admin/doc line below to enable admin documentation: 13 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 14 | 15 | # Uncomment the next line to enable the admin: 16 | # url(r'^admin/', include(admin.site.urls)), 17 | (r'^ConvertAndStream$', 'ConvertAndStream.convert_and_stream'), 18 | (r'^(?P.*)$', 'django.views.static.serve', {'document_root': '.', 'show_indexes': True}) 19 | ) 20 | -------------------------------------------------------------------------------- /Samples/py_init.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set file_path=..\..\..\PDFNetC\Lib 3 | set file=%file_path%\PDFNetPyLibInfo 4 | set local_file=%file_path%\LocalPythonInfo 5 | 6 | if not exist %file% ( 7 | echo No PDFNetPyLibInfo was found! 8 | exit /b 9 | ) 10 | 11 | set pdfnet_py_ver=2 12 | findstr /b /c:"Python 3" %file% >nul 13 | if %ERRORLEVEL% EQU 0 ( 14 | set PYTHONIOENCODING=UTF-8 15 | set pdfnet_py_ver=3 16 | ) 17 | 18 | set local_py_ver=0 19 | python.exe --version > %local_file% 2>&1 20 | findstr /b /c:"Python 3" %local_file% >nul 21 | if %ERRORLEVEL% EQU 0 ( 22 | set local_py_ver=3 23 | ) 24 | 25 | findstr /b /c:"Python 2" %local_file% >nul 26 | if %ERRORLEVEL% EQU 0 ( 27 | set local_py_ver=2 28 | ) 29 | 30 | set ERRORLEVEL=0 31 | if %pdfnet_py_ver% NEQ %local_py_ver% ( 32 | set ERRORLEVEL=2 33 | echo "ATTENTION: PDFNetPython library (Python%pdfnet_py_ver%) and Python if installed (Python%local_py_ver%) in this local machine are not compatible! Please check your python version using command 'python.exe --version' from command prompt. Then you can download the correct package (Python2 or Python3) from our website." 34 | echo "" 35 | exit /b 36 | ) -------------------------------------------------------------------------------- /Samples/py_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Find PDFNetPyLibInfo 3 | path_to_PDFNetPyLibInfo=../../../PDFNetC/Lib 4 | file=$(find $path_to_PDFNetPyLibInfo -name "PDFNetPyLibInfo") 5 | 6 | if [ -z "$file" ] ; then 7 | echo Error: No PDFNetPyLibInfo is found! 1>&2 8 | exit 1 9 | fi 10 | 11 | # Get Python version's info from PDFNetPyLibInfo 12 | count=$(grep -c "^Python 2" $file) 13 | count3=$(grep -c "^Python 3" $file) 14 | 15 | if [ $(($count+$count3)) -ne 1 ] ; then 16 | echo Error: No Python2 or Python3 was found from PDFNetPyLibInfo! 1>&2 17 | fi 18 | 19 | if [ $count -eq 1 ] ; then 20 | pylib=2 21 | elif [ $count3 -eq 1 ] ; then 22 | pylib=3 23 | fi 24 | 25 | # Select the compatible python from the user's machine if applicable 26 | py=$(which python) 27 | py3=$(which python3) 28 | if [ ! -z "$py" ] && [ $pylib -eq 2 ] ; then 29 | python_exe="python" 30 | elif [ ! -z "$py3" ] && [ $pylib -eq 3 ] ; then 31 | python_exe="python3" 32 | export PYTHONIOENCODING=UTF-8 33 | else 34 | echo Error: Python library and installed Python are not compatible! 1>&2 35 | exit 1 36 | fi 37 | 38 | -------------------------------------------------------------------------------- /Samples/runall_go.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET PATH=%cd%/../shared_libs/win/Lib/;%PATH% 3 | cd /D "%~dp0" 4 | 5 | set LICENSE_KEY="%ENV_LICENSE_KEY%" 6 | set MODULE_PATH="%ENV_MODULE_PATH%" 7 | 8 | if NOT exist go.mod ( 9 | go mod init pdftron-test 10 | go mod edit -replace github.com/pdftron/pdftron-go/v2=../ 11 | go mod edit -require github.com/pdftron/pdftron-go/v2@v2.0.0 12 | go mod tidy 13 | ) 14 | 15 | IF "%~1"=="" ( 16 | go test -v ./... -license=%LICENSE_KEY% -modulePath=%MODULE_PATH% 17 | ) ELSE (go test -v ./%1 -license=%LICENSE_KEY% -modulePath=%MODULE_PATH%) 18 | -------------------------------------------------------------------------------- /Samples/runall_go.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 4 | echo $SCIRPT_DIR 5 | cd "$SCRIPT_DIR" || exit 1 6 | 7 | LICENSE_KEY="$ENV_LICENSE_KEY" 8 | MODULE_PATH="$ENV_MODULE_PATH" 9 | 10 | if [ ! -f "go.mod" ]; then 11 | go mod init pdftron-test 12 | go mod edit -replace github.com/pdftron/pdftron-go/v2=../ 13 | go mod edit -require github.com/pdftron/pdftron-go/v2@v2.0.0 14 | go mod edit -require golang.org/x/text@v0.13.0 15 | go mod tidy 16 | fi 17 | 18 | if [ ! $# -eq 0 ] 19 | then 20 | go test ./$1 -v -license="$LICENSE_KEY" -modulePath="$MODULE_PATH" 21 | fi 22 | 23 | go test ./... -v -license="$LICENSE_KEY" -modulePath="$MODULE_PATH" 24 | -------------------------------------------------------------------------------- /Samples/runall_php.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for /D %%s in (*) do ( 3 | if exist %%s\PHP\RunTest.bat ( 4 | cd %%s\PHP 5 | echo %%s starting... 6 | call RunTest.bat 7 | cd ..\.. 8 | echo %%s finished. 9 | pause 10 | ) 11 | ) 12 | 13 | echo Run all tests finished. 14 | -------------------------------------------------------------------------------- /Samples/runall_php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for SAMPLE in * 4 | do 5 | if [ -d $SAMPLE ] 6 | then 7 | if [ -e $SAMPLE/PHP/RunTest.sh ] 8 | then 9 | cd $SAMPLE/PHP 10 | echo "$SAMPLE running" 11 | sh RunTest.sh 12 | cd ../.. 13 | echo "$SAMPLE finished. Press enter to continue..." 14 | read -p "$*" a 15 | fi 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /Samples/runall_python.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for /D %%s in (*) do ( 3 | if exist %%s\PYTHON\RunTest.bat ( 4 | cd %%s\PYTHON 5 | echo %%s starting... 6 | call RunTest.bat 7 | cd ..\.. 8 | echo %%s finished. 9 | pause 10 | ) 11 | ) 12 | 13 | echo Run all tests finished. 14 | -------------------------------------------------------------------------------- /Samples/runall_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for SAMPLE in * 4 | do 5 | if [ -d $SAMPLE ] 6 | then 7 | if [ -e $SAMPLE/PYTHON/RunTest.sh ] 8 | then 9 | cd $SAMPLE/PYTHON 10 | echo "$SAMPLE running" 11 | sh RunTest.sh 12 | cd ../.. 13 | echo "$SAMPLE finished. Press enter to continue..." 14 | read -p "$*" a 15 | fi 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /Samples/runall_ruby.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for /D %%s in (*) do ( 3 | if exist %%s\RUBY\RunTest.bat ( 4 | cd %%s\RUBY 5 | echo %%s starting... 6 | call RunTest.bat 7 | cd ..\.. 8 | echo %%s finished. 9 | pause 10 | ) 11 | ) 12 | 13 | echo Run all tests finished. 14 | -------------------------------------------------------------------------------- /Samples/runall_ruby.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for SAMPLE in * 4 | do 5 | if [ -d $SAMPLE ] 6 | then 7 | if [ -e $SAMPLE/RUBY/RunTest.sh ] 8 | then 9 | cd $SAMPLE/RUBY 10 | echo "$SAMPLE running" 11 | sh RunTest.sh 12 | cd ../.. 13 | echo "$SAMPLE finished. Press enter to continue..." 14 | read -p "$*" a 15 | fi 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /fix_rpaths.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ -f ./_PDFNetPython.so ]; then 4 | install_name_tool -rpath . "$(pwd)/" ./_PDFNetPython.so 5 | fi 6 | 7 | if [ -f ./PDFNetRuby.bundle ]; then 8 | install_name_tool -rpath . "$(pwd)/" ./PDFNetRuby.bundle 9 | fi 10 | -------------------------------------------------------------------------------- /jenkinsfiles/build_linux_arm_go.groovy: -------------------------------------------------------------------------------- 1 | String cron_default = "0 0 * * *" 2 | String cron_string = (env.BRANCH_NAME == "pre_release" || env.BRANCH_NAME == "master" || env.BRANCH_NAME == "next_release") && getWrappersBranch(env.BRANCH_NAME) != "disabled" ? cron_default : "" 3 | 4 | pipeline { 5 | agent { 6 | docker { 7 | label 'remote_linux_arm' 8 | image 'linux_arm_gowrappers:latest' 9 | registryUrl 'https://448036597521.dkr.ecr.us-east-1.amazonaws.com' 10 | registryCredentialsId 'ecr:us-east-1:Jenkins' 11 | alwaysPull true 12 | } 13 | } 14 | 15 | options { 16 | quietPeriod(60) 17 | disableConcurrentBuilds() 18 | timeout(time: 2, unit: 'HOURS') 19 | } 20 | 21 | 22 | triggers { cron(cron_string) } 23 | 24 | environment { 25 | GOCACHE = "/tmp/.cache" 26 | } 27 | 28 | 29 | parameters { 30 | string(name: "FORCE_BRANCH_VERSION", defaultValue: "" , 31 | description: "Set to a version if you wish to change the core SDK version used.") 32 | } 33 | 34 | stages { 35 | stage ('Build') { 36 | steps { 37 | script { 38 | if (params.FORCE_BRANCH_VERSION?.trim()) { 39 | s3ArtifactCopyInvoke( 40 | "PDFNetC64_GCC8_ARM64/" + params.FORCE_BRANCH_VERSION.replace("/", "%2F"), 41 | "PDFNetCArm64.tar.gz" 42 | ) 43 | } else { 44 | s3ArtifactCopyInvoke( 45 | "PDFNetC64_GCC8_ARM64/" + getWrappersBranch(env.BRANCH_NAME), 46 | "PDFNetCArm64.tar.gz" 47 | ) 48 | } 49 | } 50 | 51 | sh ''' 52 | python3 PDFTronGo/build_go.py 53 | ''' 54 | 55 | } 56 | } 57 | 58 | stage ('Run test samples') { 59 | steps { 60 | withCredentials([string(credentialsId: 'jenkins/core-sdk-key', variable: 'ENV_LICENSE_KEY')]) { 61 | dir('build/PDFTronGo/pdftron/samples') { 62 | sh ''' 63 | ./runall_go.sh 64 | ''' 65 | } 66 | } 67 | } 68 | } 69 | 70 | stage ('Upload') { 71 | steps { 72 | sh 'mv build/PDFTronGo.zip build/PDFTronGoLinuxArm.zip' 73 | s3ArtifactUpload("build/PDFTronGoLinuxArm.zip") 74 | } 75 | } 76 | } 77 | 78 | post { 79 | failure { 80 | sendMail([ 81 | currentBuild: currentBuild, 82 | env: env 83 | ]) 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /jenkinsfiles/build_linux_go.groovy: -------------------------------------------------------------------------------- 1 | String cron_default = "0 0 * * *" 2 | String cron_string = (env.BRANCH_NAME == "pre_release" || env.BRANCH_NAME == "master" || env.BRANCH_NAME == "next_release") && getWrappersBranch(env.BRANCH_NAME) != "disabled" ? cron_default : "" 3 | 4 | pipeline { 5 | agent { 6 | docker { 7 | label 'linux_fleet' 8 | image 'linux_gowrappers:latest' 9 | registryUrl 'https://448036597521.dkr.ecr.us-east-1.amazonaws.com' 10 | registryCredentialsId 'ecr:us-east-1:Jenkins' 11 | alwaysPull true 12 | } 13 | } 14 | 15 | options { 16 | quietPeriod(60) 17 | disableConcurrentBuilds() 18 | timeout(time: 2, unit: 'HOURS') 19 | } 20 | 21 | 22 | triggers { cron(cron_string) } 23 | 24 | environment { 25 | GOCACHE = "/tmp/.cache" 26 | } 27 | 28 | 29 | parameters { 30 | string(name: "FORCE_BRANCH_VERSION", defaultValue: "" , 31 | description: "Set to a version if you wish to change the core SDK version used.") 32 | } 33 | 34 | stages { 35 | stage ('Build') { 36 | steps { 37 | script { 38 | if (params.FORCE_BRANCH_VERSION?.trim()) { 39 | s3ArtifactCopyInvoke( 40 | "PDFNetC64_GCC48/" + params.FORCE_BRANCH_VERSION.replace("/", "%2F"), 41 | "PDFNetC64.tar.gz" 42 | ) 43 | } else { 44 | s3ArtifactCopyInvoke( 45 | "PDFNetC64_GCC48/" + getWrappersBranch(env.BRANCH_NAME), 46 | "PDFNetC64.tar.gz" 47 | ) 48 | } 49 | } 50 | 51 | sh ''' 52 | python3 PDFTronGo/build_go.py 53 | ''' 54 | 55 | } 56 | } 57 | 58 | stage ('Run test samples') { 59 | steps { 60 | withCredentials([string(credentialsId: 'jenkins/core-sdk-key', variable: 'ENV_LICENSE_KEY')]) { 61 | dir('build/PDFTronGo/pdftron/samples') { 62 | sh ''' 63 | ./runall_go.sh 64 | ''' 65 | } 66 | } 67 | } 68 | } 69 | 70 | stage ('Upload') { 71 | steps { 72 | sh 'mv build/PDFTronGo.zip build/PDFTronGoLinux.zip' 73 | s3ArtifactUpload("build/PDFTronGoLinux.zip") 74 | } 75 | } 76 | } 77 | 78 | post { 79 | failure { 80 | sendMail([ 81 | currentBuild: currentBuild, 82 | env: env 83 | ]) 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /jenkinsfiles/build_mac_arm_go.groovy: -------------------------------------------------------------------------------- 1 | String cron_default = "0 0 * * *" 2 | String cron_string = (env.BRANCH_NAME == "pre_release" || env.BRANCH_NAME == "master" || env.BRANCH_NAME == "next_release") && getWrappersBranch(env.BRANCH_NAME) != "disabled" ? cron_default : "" 3 | 4 | pipeline { 5 | agent { label 'Silitron' } 6 | 7 | options { 8 | quietPeriod(60) 9 | disableConcurrentBuilds() 10 | timeout(time: 2, unit: 'HOURS') 11 | } 12 | 13 | environment { 14 | GOCACHE = "/tmp/.cache" 15 | } 16 | 17 | triggers { cron(cron_string) } 18 | 19 | parameters { 20 | string(name: "FORCE_BRANCH_VERSION", defaultValue: "" , 21 | description: "Set to a version if you wish to change the core SDK version used.") 22 | } 23 | 24 | stages { 25 | stage ('Build') { 26 | steps { 27 | script { 28 | if (params.FORCE_BRANCH_VERSION?.trim()) { 29 | s3ArtifactCopyInvoke( 30 | "PDFNet Mac/" + params.FORCE_BRANCH_VERSION.replace("/", "%2F"), 31 | "PDFNetCMac.zip" 32 | ) 33 | } else { 34 | s3ArtifactCopyInvoke( 35 | "PDFNet Mac/" + getWrappersBranch(env.BRANCH_NAME), 36 | "PDFNetCMac.zip" 37 | ) 38 | } 39 | } 40 | 41 | sh ''' 42 | python3 PDFTronGo/build_go.py 43 | ''' 44 | } 45 | } 46 | 47 | stage ('Run test samples') { 48 | steps { 49 | withCredentials([string(credentialsId: 'jenkins/core-sdk-key', variable: 'ENV_LICENSE_KEY')]) { 50 | dir('build/PDFTronGo/pdftron/samples') { 51 | sh ''' 52 | ./runall_go.sh 53 | ''' 54 | } 55 | } 56 | } 57 | } 58 | 59 | stage ('Upload') { 60 | steps { 61 | sh 'mv build/PDFTronGo.zip build/PDFTronGoMacArm.zip' 62 | s3ArtifactUpload("build/PDFTronGoMacArm.zip") 63 | } 64 | } 65 | } 66 | 67 | post { 68 | failure { 69 | sendMail([ 70 | currentBuild: currentBuild, 71 | env: env 72 | ]) 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /jenkinsfiles/build_mac_go.groovy: -------------------------------------------------------------------------------- 1 | String cron_default = "0 0 * * *" 2 | String cron_string = (env.BRANCH_NAME == "pre_release" || env.BRANCH_NAME == "master" || env.BRANCH_NAME == "next_release") && getWrappersBranch(env.BRANCH_NAME) != "disabled" ? cron_default : "" 3 | 4 | 5 | pipeline { 6 | agent { label 'Courage' } 7 | 8 | options { 9 | quietPeriod(60) 10 | disableConcurrentBuilds() 11 | timeout(time: 2, unit: 'HOURS') 12 | } 13 | 14 | environment { 15 | GOCACHE = "/tmp/.cache" 16 | } 17 | 18 | triggers { cron(cron_string) } 19 | 20 | parameters { 21 | string(name: "FORCE_BRANCH_VERSION", defaultValue: "" , 22 | description: "Set to a version if you wish to change the core SDK version used.") 23 | } 24 | 25 | stages { 26 | stage ('Build') { 27 | steps { 28 | script { 29 | if (params.FORCE_BRANCH_VERSION?.trim()) { 30 | s3ArtifactCopyInvoke( 31 | "PDFNet Mac/" + params.FORCE_BRANCH_VERSION.replace("/", "%2F"), 32 | "PDFNetCMac.zip" 33 | ) 34 | } else { 35 | s3ArtifactCopyInvoke( 36 | "PDFNet Mac/" + getWrappersBranch(env.BRANCH_NAME), 37 | "PDFNetCMac.zip" 38 | ) 39 | } 40 | } 41 | 42 | sh ''' 43 | python3 PDFTronGo/build_go.py -cs /usr/local/opt/swig/bin/swig 44 | ''' 45 | } 46 | } 47 | 48 | stage ('Run test samples') { 49 | steps { 50 | withCredentials([string(credentialsId: 'jenkins/core-sdk-key', variable: 'ENV_LICENSE_KEY')]) { 51 | dir('build/PDFTronGo/pdftron/samples') { 52 | sh ''' 53 | ./runall_go.sh 54 | ''' 55 | } 56 | } 57 | } 58 | } 59 | 60 | stage ('Upload') { 61 | steps { 62 | sh 'mv build/PDFTronGo.zip build/PDFTronGoMac.zip' 63 | s3ArtifactUpload("build/PDFTronGoMac.zip") 64 | } 65 | } 66 | } 67 | 68 | post { 69 | failure { 70 | sendMail([ 71 | currentBuild: currentBuild, 72 | env: env 73 | ]) 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /jenkinsfiles/build_win_go.groovy: -------------------------------------------------------------------------------- 1 | String cron_default = "0 0 * * *" 2 | String cron_string = (env.BRANCH_NAME == "pre_release" || env.BRANCH_NAME == "master" || env.BRANCH_NAME == "next_release") && getWrappersBranch(env.BRANCH_NAME) != "disabled" ? cron_default : "" 3 | 4 | pipeline { 5 | agent { label 'windows_fleet' } 6 | 7 | options { 8 | quietPeriod(60) 9 | disableConcurrentBuilds() 10 | timeout(time: 2, unit: 'HOURS') 11 | } 12 | 13 | environment { 14 | GOCACHE = "/tmp/.cache" 15 | } 16 | 17 | triggers { cron(cron_string) } 18 | 19 | parameters { 20 | string(name: "FORCE_BRANCH_VERSION", defaultValue: "" , 21 | description: "Set to a version if you wish to change the core SDK version used.") 22 | } 23 | 24 | stages { 25 | stage ('Build') { 26 | steps { 27 | script { 28 | if (params.FORCE_BRANCH_VERSION?.trim()) { 29 | s3ArtifactCopyInvoke( 30 | "PDFNetC64 VS2013/" + params.FORCE_BRANCH_VERSION.replace("/", "%2F"), 31 | "PDFNetC64.zip" 32 | ) 33 | } else { 34 | s3ArtifactCopyInvoke( 35 | "PDFNetC64 VS2013/" + getWrappersBranch(env.BRANCH_NAME), 36 | "PDFNetC64.zip" 37 | ) 38 | } 39 | } 40 | 41 | 42 | powershell ''' 43 | python3 PDFTronGo/build_go.py 44 | ''' 45 | } 46 | } 47 | 48 | // stage ('Run test samples') { 49 | // steps { 50 | // withCredentials([string(credentialsId: 'jenkins/core-sdk-key', variable: 'ENV_LICENSE_KEY')]) { 51 | // dir('build/PDFTronGo/pdftron/samples') { 52 | // sh ''' 53 | // ./runall_go.bat 54 | // ''' 55 | // } 56 | // } 57 | // } 58 | // } 59 | 60 | stage ('Upload') { 61 | steps { 62 | powershell 'move build/PDFTronGo.zip build/PDFTronGoWin.zip' 63 | s3ArtifactUpload("build/PDFTronGoWin.zip") 64 | } 65 | } 66 | } 67 | 68 | post { 69 | failure { 70 | sendMail([ 71 | currentBuild: currentBuild, 72 | env: env 73 | ]) 74 | } 75 | } 76 | } 77 | --------------------------------------------------------------------------------