diff --git a/CMakeLists.txt b/CMakeLists.txt index 6110175f..324f6233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ #----------------------------------------------------------------------------------------------------------------------- project(PDFNetLanguageBindings CXX) -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(BUILD_PDFNetPython OFF CACHE BOOL "Build PDFNet language bindings for Python.") set(BUILD_PDFNetRuby OFF CACHE BOOL "Build PDFNet language bindings for Ruby.") diff --git a/PDFNetPHP/CMakeLists.txt b/PDFNetPHP/CMakeLists.txt index 0fdb7955..04226bd1 100644 --- a/PDFNetPHP/CMakeLists.txt +++ b/PDFNetPHP/CMakeLists.txt @@ -4,7 +4,13 @@ #----------------------------------------------------------------------------------------------------------------------- project(PDFNetPHP CXX) -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) + +find_program(PHP_CONFIG_EXECUTABLE NAMES php-config7 php-config5 php-config4 php-config) +if (NOT PHP_CONFIG_EXECUTABLE) + message(FATAL_ERROR "Cannot find php-config, please set the variable PHP_CONFIG_EXECUTABLE to the location of php-config then try again.") + return () +endif () if (WIN32) message(STATUS "Windows host platform detected.") @@ -15,14 +21,8 @@ if (WIN32) return () endif () else () - find_program(PHP_CONFIG php-config) - if (PHP_CONFIG-NOTFOUND) - message(FATAL_ERROR "Cannot find php-config, please set the variable PHP_CONFIG to the location of php-config then try again.") - return () - endif () - execute_process( - COMMAND ${PHP_CONFIG} --includes + COMMAND ${PHP_CONFIG_EXECUTABLE} --includes RESULT_VARIABLE PHP_CONFIG_INCLUDES_RESULT OUTPUT_VARIABLE PHP_CONFIG_INCLUDES ERROR_VARIABLE PHP_CONFIG_INCLUDES_ERR @@ -39,7 +39,7 @@ else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PHP_CONFIG_INCLUDES}") execute_process( - COMMAND ${PHP_CONFIG} --extension-dir + COMMAND ${PHP_CONFIG_EXECUTABLE} --extension-dir RESULT_VARIABLE PHP_CONFIG_EXT_DIR_RESULT OUTPUT_VARIABLE PHP_CONFIG_EXT_DIR ERROR_VARIABLE PHP_CONFIG_EXT_DIR_ERR @@ -58,7 +58,6 @@ message(STATUS "Generating sources for PHP bindings using swig...") set(PDFNetPHP_SourcesDir ${PROJECT_BINARY_DIR}) #configure PHP version -find_program(PHP_CONFIG_EXECUTABLE NAMES php-config7 php-config5 php-config4 php-config) if (PHP_CONFIG_EXECUTABLE) execute_process( @@ -99,13 +98,27 @@ if (("${SWIG_VERSION}" MATCHES "^2[\\.0-9]*[a-zA-Z0-9\\+]*$") AND (PHP_MAJOR_VER return () endif() +string(REGEX REPLACE "\([0-9]+\)([.a-zA-Z0-9]+)*" "\\1" SWIG_MAJOR_VERSION ${SWIG_VERSION}) +string(REGEX REPLACE "[0-9]+\\.\([0-9]+\)([.a-zA-Z0-9])*" "\\1" SWIG_MINOR_VERSION ${SWIG_VERSION}) + message(STATUS "====================================================") -message(STATUS "*** WARNING: SWIG2 doesn't work with PHP7. Please make sure either SWIG2/PHP5 or SWIG3+/PHP7 are installed. Note that only SWIG-3.0.12 and above works with PHP7. Any other combination of SWIG and PHP VERSION is likely to encounter problems!") -message(STATUS "====================================================") -message(STATUS "SWIG VERSION = ${SWIG_VERSION}") -message(STATUS "PHP_MAJOR_VERSION = ${PHP_MAJOR_VERSION}") -message(STATUS "PHP_MINOR_VERSION = ${PHP_MINOR_VERSION}") -message(STATUS "${SWIG_EXECUTABLE} -c++ -${php_version} -D${swig_php_major_arg}...") +message(STATUS "CMAKE VERSION = ${CMAKE_VERSION}") +message(STATUS "SWIG VERSION = ${SWIG_VERSION}") +message(STATUS "SWIG_MAJOR_VERSION = ${SWIG_MAJOR_VERSION}") +message(STATUS "SWIG_MINOR_VERSION = ${SWIG_MINOR_VERSION}") +message(STATUS "PHP_MAJOR_VERSION = ${PHP_MAJOR_VERSION}") +message(STATUS "PHP_MINOR_VERSION = ${PHP_MINOR_VERSION}") + +set(PHP_TARGET_FILE ON) +if((SWIG_MAJOR_VERSION LESS 4) OR (SWIG_MAJOR_VERSION EQUAL 4 AND SWIG_MINOR_VERSION LESS 1)) + if (PHP_MAJOR_VERSION GREATER 7) + message(FATAL_ERROR "ERROR! Cannot run PHP8 with SWIG 4.0 or below. Minimum is SWIG 4.1/PHP8. Please make sure you have the correct SWIG package before proceeding!") + return () + endif() +else () + set(PHP_TARGET_FILE OFF) +endif() +message(STATUS "PHP_TARGET_FILE = ${PHP_TARGET_FILE}") execute_process( COMMAND ${SWIG_EXECUTABLE} -c++ -${php_version} -DNTS -DSWIGHIDDEN_SIG -D${swig_php_major_arg} -I${PDFNetC_Include_Dir} -outdir ${PDFNetPHP_SourcesDir} -o ${PDFNetPHP_SourcesDir}/PDFNetPHP.cpp -oh ${PDFNetPHP_SourcesDir}/PDFNetPHP.hpp PDFNetPHP.i @@ -166,15 +179,7 @@ endif() # - PDFNetPHP.so/.dll set_property(TARGET PDFNetPHP PROPERTY PREFIX "") -# add namespace -execute_process( - COMMAND php ${CMAKE_SOURCE_DIR}/PDFNetPHP/script.php ${PDFNetPHP_SourcesDir}/PDFNetPHP.php - RESULT_VARIABLE SOURCE_GEN_RESULT - OUTPUT_FILE ${PROJECT_BINARY_DIR}/swig.log - ERROR_FILE ${PROJECT_BINARY_DIR}/swig.err.log - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - +if(PHP_TARGET_FILE) # Copy the bridge file configure_file(${PDFNetPHP_SourcesDir}/PDFNetPHP.php ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/PDFNetPHP.php COPYONLY) @@ -195,6 +200,8 @@ install( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/PDFNetPHP_core.php DESTINATION ${INSTALL_DESTINATION_LIB_DIR} ) +endif(PHP_TARGET_FILE) + install( TARGETS PDFNetPHP LIBRARY DESTINATION ${INSTALL_DESTINATION_LIB_DIR} diff --git a/PDFNetPHP/PDFNetPHP.i b/PDFNetPHP/PDFNetPHP.i index 9c2de062..6cbf1ccc 100644 --- a/PDFNetPHP/PDFNetPHP.i +++ b/PDFNetPHP/PDFNetPHP.i @@ -8,6 +8,11 @@ * SWIG interface file for PHP */ %module(directors="1") PDFNetPHP +#if PHP_MAJOR_VERSION > 7 +%feature("php:type", "0"); +#endif + +%rename (OCGConfig) pdftron::PDF::OCG::Config; %include "PDFNet_StdStringPHP.i" /** @@ -187,6 +192,8 @@ #include "PDF/StructuredOutputModule.h" #include "PDF/RefreshOptions.h" #include "PDF/DocumentConversion.h" + #include "PDF/DiffOptions.h" + #include "PDF/TextDiffOptions.h" #include "PDF/PDFDoc.h" #include "PDF/Convert.h" #include "PDF/PDFDocInfo.h" @@ -204,7 +211,8 @@ #include "PDF/Stamper.h" #include "PDF/TextExtractor.h" #include "PDF/TextSearch.h" - + #include "PDF/WebFontDownloader.h" + // header files in /PDFNetC/Headers/SDF #include "SDF/DictIterator.h" #include "SDF/NameTree.h" @@ -412,7 +420,7 @@ namespace pdftron { arr_hash = Z_ARRVAL_P(&$input); array_count = zend_hash_num_elements(arr_hash); - Unicode* $temp = new Unicode[array_count]; + pdftron::Unicode* $temp = new pdftron::Unicode[array_count]; for (zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); (data = zend_hash_get_current_data_ex(arr_hash, &pointer)) != NULL && i < array_count; @@ -429,7 +437,7 @@ namespace pdftron { arr_hash = Z_ARRVAL_PP($input); array_count = zend_hash_num_elements(arr_hash); - Unicode* $temp = new Unicode[array_count]; + pdftron::Unicode* $temp = new pdftron::Unicode[array_count]; for (zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); zend_hash_get_current_data_ex(arr_hash, (void**) &data, &pointer) == SUCCESS && i < array_count; @@ -462,7 +470,7 @@ namespace pdftron { */ %typemap(freearg) const pdftron::Unicode* text_data %{ - delete[]($1); + if($1){ delete[]($1); $1 = 0; } %} //---------------------------------------------------------------------------------------------- @@ -580,7 +588,7 @@ namespace pdftron { %typemap(freearg) std::vector& %{ - delete ($1); + if($1){ delete($1);$1 = 0;} %} //---------------------------------------------------------------------------------------------- @@ -776,6 +784,40 @@ namespace pdftron { %rename (WriteUInt64) pdftron::Filters::FilterWriter::WriteInt(UInt64); %rename (IsEqual) operator==; +// rename overridden methods of different signatures from base', which causes fatal errors in PHP8 +#if PHP_MAJOR_VERSION > 7 +%ignore pdftron::PDF::Annots::Popup::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::FileAttachment::Create(SDF::SDFDoc&, const Rect&, FileSpec); +%ignore pdftron::PDF::Annots::FileAttachment::Create(SDF::SDFDoc&, const Rect&, FileSpec, Icon); +%ignore pdftron::PDF::Annots::FileAttachment::Create(SDF::SDFDoc&, const Rect&, const UString&); +%ignore pdftron::PDF::Annots::FileAttachment::Create(SDF::SDFDoc&, const Rect&, const UString&, Icon); +%ignore pdftron::PDF::Annots::FileAttachment::Create(SDF::SDFDoc&, const Rect&, const UString&, const char*); +%ignore pdftron::PDF::Annots::Ink::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Circle::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::HighlightAnnot::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::LineAnnot::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::FreeText::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Movie::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::RedactionAnnot::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Screen::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Square::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Squiggly::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::StrikeOut::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Underline::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Watermark::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::RubberStamp::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::RubberStamp::Create(SDF::SDFDoc&, const Rect&, Icon); +%ignore pdftron::PDF::Annots::Sound::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Sound::Create(SDF::SDFDoc&, const Rect&, Icon); +%ignore pdftron::PDF::Annots::Sound::Create(SDF::SDFDoc&, const Point&); +%ignore pdftron::PDF::Annots::Sound::Create(SDF::SDFDoc&, const Point&, Icon); +%ignore pdftron::PDF::Annots::Text::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Text::Create(SDF::SDFDoc&, const Rect&, const UString&); +%ignore pdftron::PDF::Annots::Text::Create(SDF::SDFDoc&, const Point&); +%ignore pdftron::PDF::Annots::Text::Create(SDF::SDFDoc&, const Point&, const UString&); +%ignore pdftron::PDF::Annots::Link::Create(SDF::SDFDoc&, const Rect&); +%ignore pdftron::PDF::Annots::Link::Create(SDF::SDFDoc&, const Rect&, const Action&); +#endif //---------------------------------------------------------------------------------------------- // Fixes the python not recognizing default arguments problem // Instead of generating overloaded method for default arguments, only a single method @@ -888,6 +930,8 @@ namespace pdftron { %include "PDF/Bookmark.h" %include "PDF/CharData.h" %include "PDF/ContentReplacer.h" +%include "PDF/DiffOptions.h" +%include "PDF/TextDiffOptions.h" %include "PDF/ConversionOptions.h" %include "PDF/OfficeToPDFOptions.h" %include "PDF/WordToPDFOptions.h" @@ -958,6 +1002,7 @@ namespace pdftron { %include "PDF/PDFDC.h" %include "PDF/PDFDCEX.h" %include "PDF/PDFDraw.h" +%include "PDF/WebFontDownloader.h" //Extend Initialize method to call overloaded one internally %extend pdftron::PDFNet{ diff --git a/PDFNetPHP/PDFNetPHP.php b/PDFNetPHP/PDFNetPHP.php index f80f65a4..b384e41b 100644 --- a/PDFNetPHP/PDFNetPHP.php +++ b/PDFNetPHP/PDFNetPHP.php @@ -1,8 +1,10 @@ = 7) { - set_error_handler(function ($errno, $errstr) { - return strpos($errstr, 'Declaration of') === 0; - }, E_WARNING); +if (PHP_MAJOR_VERSION <= 7) { + if (PHP_MAJOR_VERSION == 7){ + set_error_handler(function ($errno, $errstr) { + return strpos($errstr, 'Declaration of') === 0; + }, E_WARNING); + } + include ("PDFNetPHP_core.php"); } -include ("PDFNetPHP_core.php"); ?> diff --git a/PDFNetPHP/PDFNetUStringPHP.i b/PDFNetPHP/PDFNetUStringPHP.i index 8e3d401b..ea0be22a 100644 --- a/PDFNetPHP/PDFNetUStringPHP.i +++ b/PDFNetPHP/PDFNetUStringPHP.i @@ -26,7 +26,7 @@ namespace pdftron { convert_to_string_ex($input); char* temp$argnum = Z_STRVAL_PP($input); #endif - $1 = UString(temp$argnum); + $1 = pdftron::UString(temp$argnum); } %typemap(out) UString, const UString @@ -40,7 +40,7 @@ namespace pdftron { } /** - * Typemap between UString const & and Python string + * Typemap between UString const & and PHP string */ %typemap(in) UString const & { @@ -51,7 +51,7 @@ namespace pdftron { convert_to_string_ex($input); char* temp$argnum = Z_STRVAL_PP($input); #endif - $1 = new UString(temp$argnum); + $1 = new pdftron::UString(temp$argnum); } /** @@ -71,7 +71,7 @@ namespace pdftron { */ %typemap(freearg) UString const & %{ - delete($1); + if($1){ delete($1); $1 = 0; } %} /** diff --git a/PDFNetPHP/PDFNet_StdStringPHP.i b/PDFNetPHP/PDFNet_StdStringPHP.i index f0d38d4c..fc2bd703 100644 --- a/PDFNetPHP/PDFNet_StdStringPHP.i +++ b/PDFNetPHP/PDFNet_StdStringPHP.i @@ -152,6 +152,6 @@ %typemap(freearg) std::vector& %{ - delete ($1); + if($1){ delete($1); $1 = 0; } %} diff --git a/PDFNetPHP/script.php b/PDFNetPHP/script.php deleted file mode 100644 index 57754c9b..00000000 --- a/PDFNetPHP/script.php +++ /dev/null @@ -1,13 +0,0 @@ -getMessage(), "\n"; -} -?> - diff --git a/PDFNetPython/CMakeLists.txt b/PDFNetPython/CMakeLists.txt index 00cf6783..66f060b7 100644 --- a/PDFNetPython/CMakeLists.txt +++ b/PDFNetPython/CMakeLists.txt @@ -4,7 +4,7 @@ #----------------------------------------------------------------------------------------------------------------------- project(PDFNetPython CXX) -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) find_package(PythonLibs) diff --git a/PDFNetPython/PDFNetPython.i b/PDFNetPython/PDFNetPython.i index ea6efdff..a1a5c106 100644 --- a/PDFNetPython/PDFNetPython.i +++ b/PDFNetPython/PDFNetPython.i @@ -188,6 +188,8 @@ #include "PDF/StructuredOutputModule.h" #include "PDF/RefreshOptions.h" #include "PDF/DocumentConversion.h" + #include "PDF/DiffOptions.h" + #include "PDF/TextDiffOptions.h" #include "PDF/PDFDoc.h" #include "PDF/Convert.h" #include "PDF/PDFDocInfo.h" @@ -205,6 +207,7 @@ #include "PDF/Stamper.h" #include "PDF/TextExtractor.h" #include "PDF/TextSearch.h" + #include "PDF/WebFontDownloader.h" // header files in /PDFNetC/Headers/SDF #include "SDF/DictIterator.h" @@ -392,7 +395,7 @@ namespace pdftron { #ifdef PYTHON2 %typemap(in) const pdftron::Unicode* text_data { - Unicode* $temp = new Unicode[PyList_Size($input)]; + pdftron::Unicode* $temp = new pdftron::Unicode[PyList_Size($input)]; int i; for (i = 0; i < PyList_Size($input); i++) { @@ -463,7 +466,7 @@ namespace pdftron { */ %typemap(freearg) const pdftron::Unicode* text_data %{ - delete[]($1); + if($1){ delete[]($1); $1 = 0; } %} //---------------------------------------------------------------------------------------------- @@ -504,7 +507,7 @@ namespace pdftron { %typemap(freearg) std::vector& %{ - delete ($1); + if($1){ delete($1);$1 = 0;} %} %typemap(typecheck) std::vector { @@ -760,6 +763,8 @@ namespace pdftron { %include "PDF/Bookmark.h" %include "PDF/CharData.h" %include "PDF/ContentReplacer.h" +%include "PDF/DiffOptions.h" +%include "PDF/TextDiffOptions.h" %include "PDF/ConversionOptions.h" %include "PDF/OfficeToPDFOptions.h" %include "PDF/WordToPDFOptions.h" @@ -830,6 +835,7 @@ namespace pdftron { %include "PDF/PDFDC.h" %include "PDF/PDFDCEX.h" %include "PDF/PDFDraw.h" +%include "PDF/WebFontDownloader.h" //Extend Initialize method to call overloaded one internally %extend pdftron::PDFNet{ diff --git a/PDFNetPython/PDFNetUStringPython2.i b/PDFNetPython/PDFNetUStringPython2.i index 5c28702d..ac535766 100644 --- a/PDFNetPython/PDFNetUStringPython2.i +++ b/PDFNetPython/PDFNetUStringPython2.i @@ -28,12 +28,12 @@ namespace pdftron { return NULL; } if (isStr$argnum) { - $1 = UString(PyString_AsString($input)); + $1 = pdftron::UString(PyString_AsString($input)); } else if (isUni$argnum) { PyObject* obj = PyUnicode_AsUTF8String($input); char* str = PyString_AsString(obj); - $1 = UString(str); + $1 = pdftron::UString(str); Py_DECREF(obj); } } @@ -76,12 +76,12 @@ namespace pdftron { Swig::DirectorMethodException::raise("Expected a String or a Unicode"); } if (isStr$argnum) { - $result = UString(PyString_AsString($1)); + $result = pdftron::UString(PyString_AsString($1)); } else if (isUni$argnum) { PyObject* obj = PyUnicode_AsUTF8String($1); char* str = PyString_AsString(obj); - $result = UString(str); + $result = pdftron::UString(str); Py_DECREF(obj); } } @@ -99,12 +99,12 @@ namespace pdftron { return NULL; } if (isStr$argnum) { - $1 = new UString(PyString_AsString($input), -1, UString::e_utf8); + $1 = new pdftron::UString(PyString_AsString($input), -1, UString::e_utf8); } else if (isUni$argnum) { PyObject* obj = PyUnicode_AsUTF8String($input); char* str = PyString_AsString(obj); - $1 = new UString(str, -1, UString::e_utf8); + $1 = new pdftron::UString(str, -1, UString::e_utf8); Py_DECREF(obj); } } @@ -122,6 +122,6 @@ namespace pdftron { */ %typemap(freearg) UString const & %{ - delete($1); + if($1){ delete($1); $1 = 0; } %} } diff --git a/PDFNetPython/PDFNetUStringPython3.i b/PDFNetPython/PDFNetUStringPython3.i index 9b35f53e..931101d5 100644 --- a/PDFNetPython/PDFNetUStringPython3.i +++ b/PDFNetPython/PDFNetUStringPython3.i @@ -25,7 +25,7 @@ namespace pdftron { return NULL; } PyObject* bytes$argnum = PyUnicode_AsUTF8String($input); - $1 = (UString(PyBytes_AsString(bytes$argnum))); + $1 = (pdftron::UString(PyBytes_AsString(bytes$argnum))); Py_DECREF(bytes$argnum); } @@ -67,7 +67,7 @@ namespace pdftron { Swig::DirectorMethodException::raise("Expected a String or a Unicode"); } if (isStr$argnum) { - $result = UString(PyString_AsString($1)); + $result = pdftron::UString(PyString_AsString($1)); } else if (isUni$argnum) { PyObject* obj = PyUnicode_AsUTF8String($1); @@ -104,6 +104,6 @@ namespace pdftron { */ %typemap(freearg) UString const & %{ - delete($1); + if($1){ delete($1); $1 = 0; } %} } diff --git a/PDFNetRuby/CMakeLists.txt b/PDFNetRuby/CMakeLists.txt index 7ca3d494..49b03f01 100644 --- a/PDFNetRuby/CMakeLists.txt +++ b/PDFNetRuby/CMakeLists.txt @@ -4,7 +4,7 @@ #----------------------------------------------------------------------------------------------------------------------- project(PDFNetRuby CXX) -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) find_package(Ruby) diff --git a/PDFNetRuby/PDFNetRuby.i b/PDFNetRuby/PDFNetRuby.i index 00d318e4..0dd9594f 100644 --- a/PDFNetRuby/PDFNetRuby.i +++ b/PDFNetRuby/PDFNetRuby.i @@ -177,6 +177,8 @@ #include "PDF/StructuredOutputModule.h" #include "PDF/RefreshOptions.h" #include "PDF/DocumentConversion.h" + #include "PDF/DiffOptions.h" + #include "PDF/TextDiffOptions.h" #include "PDF/PDFDoc.h" #include "PDF/Convert.h" #include "PDF/PDFDocInfo.h" @@ -194,6 +196,7 @@ #include "PDF/Stamper.h" #include "PDF/TextExtractor.h" #include "PDF/TextSearch.h" + #include "PDF/WebFontDownloader.h" // header files in /PDFNetC/Headers/SDF #include "SDF/DictIterator.h" @@ -364,7 +367,7 @@ namespace pdftron { for (i = 0; i < size; i++) { VALUE val = rb_ary_entry($input, i); if (rb_type(val) == T_STRING) { - $temp[i] = (Unicode)(*StringValuePtr(val)); + $temp[i] = (pdftron::Unicode)(*StringValuePtr(val)); } else if (FIXNUM_P(val)) { $temp[i] = FIX2INT(val); @@ -388,7 +391,7 @@ namespace pdftron { */ %typemap(freearg) const pdftron::Unicode* text_data %{ - delete[]($1); + if($1){ delete[]($1); $1 = 0; } %} //---------------------------------------------------------------------------------------------- @@ -434,7 +437,7 @@ namespace pdftron { %typemap(freearg) std::vector& %{ - delete ($1); + if($1){ delete($1);$1 = 0;} %} //---------------------------------------------------------------------------------------------- @@ -679,6 +682,8 @@ namespace pdftron { %include "PDF/Bookmark.h" %include "PDF/CharData.h" %include "PDF/ContentReplacer.h" +%include "PDF/DiffOptions.h" +%include "PDF/TextDiffOptions.h" %include "PDF/ConversionOptions.h" %include "PDF/OfficeToPDFOptions.h" %include "PDF/WordToPDFOptions.h" @@ -747,6 +752,7 @@ namespace pdftron { %include "PDF/PDFDC.h" %include "PDF/PDFDCEX.h" %include "PDF/PDFDraw.h" +%include "PDF/WebFontDownloader.h" //Extend Initialize method to call overloaded one internally %extend pdftron::PDFNet{ diff --git a/PDFNetRuby/PDFNetUStringRuby.i b/PDFNetRuby/PDFNetUStringRuby.i index bdcc8fe4..6042dd92 100644 --- a/PDFNetRuby/PDFNetUStringRuby.i +++ b/PDFNetRuby/PDFNetUStringRuby.i @@ -20,7 +20,7 @@ namespace pdftron { %typemap(in) UString, const UString { char* str = StringValuePtr($input); - $1 = UString(str); + $1 = pdftron::UString(str); } %typemap(out) UString, const UString @@ -35,7 +35,7 @@ namespace pdftron { %typemap(in) UString const & { char* str = StringValuePtr($input); - $1 = new UString(str); + $1 = new pdftron::UString(str); } @@ -51,7 +51,7 @@ namespace pdftron { %typemap(directorout) UString, const UString { char* str = StringValuePtr($1); - $result = UString(str); + $result = pdftron::UString(str); } /** @@ -72,6 +72,6 @@ namespace pdftron { */ %typemap(freearg) UString const & %{ - delete($1); + if($1){ delete($1); $1 = 0; } %} } diff --git a/PDFTronGo/CMakeLists.txt b/PDFTronGo/CMakeLists.txt index 668e72f1..3901ef57 100644 --- a/PDFTronGo/CMakeLists.txt +++ b/PDFTronGo/CMakeLists.txt @@ -4,7 +4,7 @@ #----------------------------------------------------------------------------------------------------------------------- project(PDFTronGo CXX) -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) find_program(GO_EXECUTABLE go PATHS $ENV{HOME}/go ENV GOROOT GOPATH PATH_SUFFIXES bin) if(GO_EXECUTABLE) diff --git a/PDFTronGo/pdftron.i b/PDFTronGo/pdftron.i index 0440b631..80f5109c 100644 --- a/PDFTronGo/pdftron.i +++ b/PDFTronGo/pdftron.i @@ -145,6 +145,8 @@ #include "PDF/StructuredOutputModule.h" #include "PDF/RefreshOptions.h" #include "PDF/DocumentConversion.h" + #include "PDF/DiffOptions.h" + #include "PDF/TextDiffOptions.h" #include "PDF/PDFDoc.h" #include "PDF/Convert.h" #include "PDF/PDFDocInfo.h" @@ -161,6 +163,7 @@ #include "PDF/Stamper.h" #include "PDF/TextExtractor.h" #include "PDF/TextSearch.h" + #include "PDF/WebFontDownloader.h" // header files in /PDFNetC/Headers/SDF #include "SDF/DictIterator.h" @@ -406,6 +409,8 @@ namespace pdftron { %include "PDF/Bookmark.h" %include "PDF/CharData.h" %include "PDF/ContentReplacer.h" +%include "PDF/DiffOptions.h" +%include "PDF/TextDiffOptions.h" %include "PDF/ConversionOptions.h" %include "PDF/OfficeToPDFOptions.h" %include "PDF/WordToPDFOptions.h" @@ -473,6 +478,7 @@ namespace pdftron { %include "PDF/PDFDC.h" %include "PDF/PDFDCEX.h" %include "PDF/PDFDraw.h" +%include "PDF/WebFontDownloader.h" //Extend Initialize method to call overloaded one internally %extend pdftron::PDFNet{ diff --git a/README.md b/README.md index acf8ef04..1be8d88d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This project uses SWIG (http://www.swig.org/) in order to generate the language ## Environments and versions -* **SWIG** 2.0.4 - 2.0.12 and **SWIG** 3.0.12 +* **SWIG** 2.0.4 - 2.0.12 or **SWIG** 3.0.12 or **SWIG** 4.0.2 and above * **CMake** version 2.8+ * **Linux**: GCC 4.6 and above * **Windows**: Visual Studio 2012 and above or mingw-w64 (for Go only) @@ -31,9 +31,13 @@ Lastly, you will need to obtain the most recent package for PDFNetC. The package Having a **single version of SWIG and PHP installed** on the server is preferred. Any other combinations of SWIG and PHP versions not listed below is likely to encounter problems. If your build is not working as expected then please double check the version numbers. Installing multiple versions of SWIG and PHP may also produce issues. +* Targeting **PHP8** + + * **PHP8** with developer extensions and **SWIG (4.1.0)** or above + * Targeting **PHP7** - * **PHP7** with developer extensions and **SWIG3 (3.0.12)** or above + * **PHP7** with developer extensions and **SWIG (3.0.12 - 4.0.2)** * Targeting **PHP5** @@ -119,8 +123,45 @@ Suppose you wanted to build and run the 64-bit `GO` wrappers on `Windows`. You More information at [PDFTron SDK for Go](https://www.pdftron.com/documentation/go) +## Linux +Suppose you wanted to build and run the 64-bit `PHP8` wrappers on `Linux`. You could run the following set of commands: + + # First, install swig 4.1.0 for PHP8 wrapper using swig/master branch + mkdir Swig + cd Swig + git clone https://github.com/swig/swig.git + cd swig + mkdir Build + cd Build + cmake .. + sudo apt install + swig -version # check to make sure swig version 4.1.0 + + # Now, build PHP wrapper. Navigate to the location where you want to build the wrapper + mkdir wrappers_build # Make a directory to build the wrappers in. + cd wrappers_build # Move to that directory. + git clone https://github.com/PDFTron/PDFNetWrappers -b next_release --single-branch # Git the code. + cd PDFNetWrappers/PDFNetC # Move to where we download PDFNet. + wget https://www.pdftron.com/downloads/PDFNetC64_PHP8.tar.gz # Download PDFNet. + tar xzvf PDFNetC64_PHP8.tar.gz # Unpack PDFNet. + mv PDFNetC64/Headers/ . # Move PDFNet Headers/ into place. + mv PDFNetC64/Lib/ . # Move PDFNet Lib/ into place. + cd .. # Go back up. + mkdir Build # Create a directory to create the Makefiles in. + cd Build # Move to that directory. + sudo apt-get install php-dev # or sudo yum install php-devel, to add php-dev for required PHP include directories + cmake -D BUILD_PDFNetPHP=ON .. # Create the Makefiles with CMake. + make # Build the PHP wrappers with SWIG. + sudo make install # Copy the PHP wrappers to where the samples can find them. + cd ../Samples # Move to the Samples directory. + ./runall_php.sh # Run all PHP code samples, using the new wrappers. + +Please note that you may need to register PDFNetPHP.so as an extension to your PHP by adding the following line in your php.ini: + + extension=/full/path/to/PDFNetPHP.so + ## Linux -Suppose you wanted to build and run the 64-bit `PHP` wrappers on `Linux`. You could run the following set of commands: +Suppose you wanted to build and run the 64-bit `PHP7` wrappers on `Linux`. You could run the following set of commands: mkdir wrappers_build # Make a directory to build the wrappers in. cd wrappers_build # Move to that directory. diff --git a/Samples/AddImageTest/PHP/AddImageTest.php b/Samples/AddImageTest/PHP/AddImageTest.php index e87180da..88eb03df 100644 --- a/Samples/AddImageTest/PHP/AddImageTest.php +++ b/Samples/AddImageTest/PHP/AddImageTest.php @@ -1,9 +1,9 @@ GetAction(); - if (!$action->IsValid()) continue; + if (!$action->IsValid()) continue 2; if ($action->GetType() == Action::e_GoTo) { $dest = $action->GetDest(); @@ -72,28 +72,28 @@ function AnnotationHighLevelAPI($doc) { $first_page = $doc->GetPage(1); // Create a hyperlink... - $hyperlink = Link::Create($doc->GetSDFDoc(), new Rect(85.0, 570.0, 503.0, 524.0), Action::CreateURI($doc->GetSDFDoc(), "http://www.pdftron.com")); + $hyperlink = Link::CreateAnnot($doc->GetSDFDoc(), new Rect(85.0, 570.0, 503.0, 524.0), Action::CreateURI($doc->GetSDFDoc(), "http://www.pdftron.com")); $first_page->AnnotPushBack($hyperlink); // Create an intra-document link... $goto_page_3 = Action::CreateGoto(Destination::CreateFitH($doc->GetPage(3), 0)); - $link = Link::Create($doc->GetSDFDoc(), new Rect(85.0, 458.0, 503.0, 502.0), $goto_page_3); + $link = Link::CreateAnnot($doc->GetSDFDoc(), new Rect(85.0, 458.0, 503.0, 502.0), $goto_page_3); $link->SetColor(new ColorPt(0.0, 0.0, 1.0)); // Add the new annotation to the first page $first_page->AnnotPushBack($link); // Create a stamp annotation ... - $stamp = RubberStamp::Create($doc->GetSDFDoc(), new Rect(30.0, 30.0, 300.0, 200.0)); + $stamp = RubberStamp::CreateAnnot($doc->GetSDFDoc(), new Rect(30.0, 30.0, 300.0, 200.0)); $stamp->SetIcon("Draft"); $first_page->AnnotPushBack($stamp); // Create a file attachment annotation (embed the 'peppers.jpg'). global $input_path; - $file_attach = FileAttachment::Create($doc->GetSDFDoc(), new Rect(80.0, 280.0, 108.0, 320.0), ($input_path."peppers.jpg")); + $file_attach = FileAttachment::CreateAnnot($doc->GetSDFDoc(), new Rect(80.0, 280.0, 108.0, 320.0), ($input_path."peppers.jpg")); $first_page->AnnotPushBack($file_attach); - $ink = Ink::Create($doc->GetSDFDoc(), new Rect(110.0, 10.0, 300.0, 200.0)); + $ink = Ink::CreateAnnot($doc->GetSDFDoc(), new Rect(110.0, 10.0, 300.0, 200.0)); $pt3 = new Point(110.0, 10.0); $ink->SetPoint(0, 0, $pt3); $pt3->x = 150; $pt3->y = 50; @@ -192,7 +192,7 @@ function CreateTestAnnots($doc) { // // Test of a free text annotation. // - $txtannot = FreeText::Create( $doc->GetSDFDoc(), new Rect(10.0, 400.0, 160.0, 570.0) ); + $txtannot = FreeText::CreateAnnot( $doc->GetSDFDoc(), new Rect(10.0, 400.0, 160.0, 570.0) ); $txtannot->SetContents( "\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." ."\n\nAha!\n\nAnd there was much rejoicing!"); $txtannot->SetBorderStyle( new BorderStyle( BorderStyle::e_solid, 1.0, 10.0, 20.0 ), false ); @@ -200,7 +200,7 @@ function CreateTestAnnots($doc) { $first_page->AnnotPushBack($txtannot); $txtannot->RefreshAppearance(); - $txtannot = FreeText::Create( $doc->GetSDFDoc(), new Rect(100.0, 100.0, 350.0, 500.0) ); + $txtannot = FreeText::CreateAnnot( $doc->GetSDFDoc(), new Rect(100.0, 100.0, 350.0, 500.0) ); $txtannot->SetContentRect( new Rect( 200.0, 200.0, 350.0, 500.0 ) ); $txtannot->SetContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." ."\n\nAha!\n\nAnd there was much rejoicing!"); @@ -212,7 +212,7 @@ function CreateTestAnnots($doc) { $first_page->AnnotPushBack($txtannot); $txtannot->RefreshAppearance(); - $txtannot = FreeText::Create( $doc->GetSDFDoc(), new Rect(400.0, 10.0, 550.0, 400.0) ); + $txtannot = FreeText::CreateAnnot( $doc->GetSDFDoc(), new Rect(400.0, 10.0, 550.0, 400.0) ); $txtannot->SetContents("\n\nSome swift brown fox snatched a gray hare out of the air by freezing it with an angry glare." ."\n\nAha!\n\nAnd there was much rejoicing!"); $txtannot->SetBorderStyle( new BorderStyle( BorderStyle::e_solid, 1.0, 10.0, 20.0 ), false ); @@ -229,7 +229,7 @@ function CreateTestAnnots($doc) { $ew->End(); // save changes to the current page //Create a Line annotation... - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(250.0, 250.0, 400.0, 400.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(250.0, 250.0, 400.0, 400.0)); $line->SetStartPoint( new Point(350.0, 270.0) ); $line->SetEndPoint( new Point(260.0,370.0) ); $line->SetStartStyle(LineAnnot::e_Square); @@ -242,7 +242,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(347.0, 377.0, 600.0, 600.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(347.0, 377.0, 600.0, 600.0)); $line->SetStartPoint( new Point(385.0, 410.0) ); $line->SetEndPoint( new Point(540.0,555.0) ); $line->SetStartStyle(LineAnnot::e_Circle); @@ -258,7 +258,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(10.0, 400.0, 200.0, 600.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(10.0, 400.0, 200.0, 600.0)); $line->SetStartPoint( new Point(25.0, 426.0) ); $line->SetEndPoint( new Point(180.0,555.0) ); $line->SetStartStyle(LineAnnot::e_Circle); @@ -273,7 +273,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(200.0, 10.0, 400.0, 70.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(200.0, 10.0, 400.0, 70.0)); $line->SetStartPoint( new Point(220.0, 25.0) ); $line->SetEndPoint( new Point(370.0,60.0) ); $line->SetStartStyle(LineAnnot::e_Butt); @@ -285,7 +285,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(200.0, 70.0, 400.0, 130.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(200.0, 70.0, 400.0, 130.0)); $line->SetStartPoint( new Point(220.0, 111.0) ); $line->SetEndPoint( new Point(370.0,78.0) ); $line->SetStartStyle(LineAnnot::e_Circle); @@ -298,7 +298,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect(10.0, 100.0, 160.0, 200.0)); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect(10.0, 100.0, 160.0, 200.0)); $line->SetStartPoint( new Point(15.0, 110.0) ); $line->SetEndPoint( new Point(150.0, 190.0) ); $line->SetStartStyle(LineAnnot::e_Slash); @@ -311,7 +311,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect( 270.0, 270.0, 570.0, 433.0 )); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect( 270.0, 270.0, 570.0, 433.0 )); $line->SetStartPoint( new Point(300.0, 400.0 ) ); $line->SetEndPoint( new Point(550.0, 300.0) ); $line->SetStartStyle(LineAnnot::e_RClosedArrow); @@ -324,13 +324,13 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect( 195.0, 395.0, 205.0, 505.0 )); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect( 195.0, 395.0, 205.0, 505.0 )); $line->SetStartPoint( new Point(200.0, 400.0 ) ); $line->SetEndPoint( new Point(200.0, 500.0) ); $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect( 55.0, 299.0, 150.0, 301.0 )); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect( 55.0, 299.0, 150.0, 301.0 )); $line->SetStartPoint( new Point(55.0, 300.0 ) ); $line->SetEndPoint( new Point(155.0, 300.0) ); $line->SetStartStyle(LineAnnot::e_Circle); @@ -343,7 +343,7 @@ function CreateTestAnnots($doc) { $line->RefreshAppearance(); $page->AnnotPushBack($line); - $line = LineAnnot::Create($doc->GetSDFDoc(), new Rect( 300.0, 200.0, 390.0, 234.0 )); + $line = LineAnnot::CreateAnnot($doc->GetSDFDoc(), new Rect( 300.0, 200.0, 390.0, 234.0 )); $line->SetStartPoint( new Point(310.0, 210.0 ) ); $line->SetEndPoint( new Point(380.0, 220.0) ); $line->SetColor(new ColorPt(0.0, 0.0, 0.0), 3); @@ -355,12 +355,12 @@ function CreateTestAnnots($doc) { $ew->End(); // save changes to the current page $doc->PagePushBack($page3); - $circle = Circle::Create($doc->GetSDFDoc(), new Rect( 300.0, 300.0, 390.0, 350.0 )); + $circle = Circle::CreateAnnot($doc->GetSDFDoc(), new Rect( 300.0, 300.0, 390.0, 350.0 )); $circle->SetColor(new ColorPt(0.0, 0.0, 0.0), 3); $circle->RefreshAppearance(); $page3->AnnotPushBack($circle); - $circle = Circle::Create($doc->GetSDFDoc(), new Rect( 100.0, 100.0, 200.0, 200.0 )); + $circle = Circle::CreateAnnot($doc->GetSDFDoc(), new Rect( 100.0, 100.0, 200.0, 200.0 )); $circle->SetColor(new ColorPt(0.0, 1.0, 0.0), 3); $circle->SetInteriorColor(new ColorPt(0.0, 0.0, 1.0), 3); $circle->SetBorderStyle( new BorderStyle( BorderStyle::e_dashed, 3.0, 0.0, 0.0, array(2.0, 4.0)) ); @@ -368,12 +368,12 @@ function CreateTestAnnots($doc) { $circle->RefreshAppearance(); $page3->AnnotPushBack($circle); - $sq = Square::Create( $doc->GetSDFDoc(), new Rect(10.0,200.0, 80.0, 300.0 ) ); + $sq = Square::CreateAnnot( $doc->GetSDFDoc(), new Rect(10.0,200.0, 80.0, 300.0 ) ); $sq->SetColor(new ColorPt(0.0, 0.0, 0.0), 3); $sq->RefreshAppearance(); $page3->AnnotPushBack( $sq ); - $sq = Square::Create( $doc->GetSDFDoc(), new Rect(500.0,200.0, 580.0, 300.0 ) ); + $sq = Square::CreateAnnot( $doc->GetSDFDoc(), new Rect(500.0,200.0, 580.0, 300.0 ) ); $sq->SetColor(new ColorPt(1.0, 0.0, 0.0), 3); $sq->SetInteriorColor(new ColorPt(0.0, 1.0, 1.0), 3); $sq->SetBorderStyle( new BorderStyle( BorderStyle::e_dashed, 6.0, 0.0, 0.0, array(4.0, 2.0) ) ); @@ -381,7 +381,7 @@ function CreateTestAnnots($doc) { $sq->RefreshAppearance(); $page3->AnnotPushBack( $sq ); - $poly = Polygon::Create($doc->GetSDFDoc(), new Rect(5.0, 500.0, 125.0, 590.0)); + $poly = Polygon::CreateAnnot($doc->GetSDFDoc(), new Rect(5.0, 500.0, 125.0, 590.0)); $poly->SetColor(new ColorPt(1.0, 0.0, 0.0), 3); $poly->SetInteriorColor(new ColorPt(1.0, 1.0, 0.0), 3); $poly->SetVertex(0, new Point(12.0,510.0) ); @@ -393,7 +393,7 @@ function CreateTestAnnots($doc) { $poly->RefreshAppearance(); $page3->AnnotPushBack( $poly ); - $poly = PolyLine::Create($doc->GetSDFDoc(), new Rect(400.0, 10.0, 500.0, 90.0)); + $poly = PolyLine::CreateAnnot($doc->GetSDFDoc(), new Rect(400.0, 10.0, 500.0, 90.0)); $poly->SetColor(new ColorPt(1.0, 0.0, 0.0), 3); $poly->SetInteriorColor(new ColorPt(0.0, 1.0, 0.0), 3); $poly->SetVertex(0, new Point(405.0,20.0) ); @@ -407,7 +407,7 @@ function CreateTestAnnots($doc) { $poly->RefreshAppearance(); $page3->AnnotPushBack( $poly ); - $lk = Link::Create( $doc->GetSDFDoc(), new Rect(5.0,5.0,55.0,24.0) ); + $lk = Link::CreateAnnot( $doc->GetSDFDoc(), new Rect(5.0,5.0,55.0,24.0) ); //$lk->SetColor( new ColorPt(0.0,1.0,0.0), 3.0 ); $lk->RefreshAppearance(); $page3->AnnotPushBack( $lk ); @@ -428,12 +428,12 @@ function CreateTestAnnots($doc) { $ew->WriteElement( $eb->CreateTextEnd() ); $ew->End(); - $hl = HighlightAnnot::Create( $doc->GetSDFDoc(), new Rect(100.0,490.0,150.0,515.0) ); + $hl = HighlightAnnot::CreateAnnot( $doc->GetSDFDoc(), new Rect(100.0,490.0,150.0,515.0) ); $hl->SetColor( new ColorPt(0.0,1.0,0.0), 3 ); $hl->RefreshAppearance(); $page4->AnnotPushBack( $hl ); - $sq = Squiggly::Create( $doc->GetSDFDoc(), new Rect(100.0,450.0,250.0,600.0) ); + $sq = Squiggly::CreateAnnot( $doc->GetSDFDoc(), new Rect(100.0,450.0,250.0,600.0) ); $sq->SetQuadPoint( 0, new QuadPoint( new Point( 122.0,455.0), new Point(240.0, 545.0), new Point(230.0, 595.0), new Point(101.0,500.0 ) ) ); $sq->RefreshAppearance(); $page4->AnnotPushBack( $sq ); @@ -456,14 +456,14 @@ function CreateTestAnnots($doc) { $doc->PagePushBack($page6); - $txt = Text::Create( $doc->GetSDFDoc(), new Point(10.0, 20.0) ); + $txt = Text::CreateAnnot( $doc->GetSDFDoc(), new Point(10.0, 20.0) ); $txt->SetIcon( "UserIcon" ); $txt->SetContents( "User defined icon, unrecognized by appearance generator" ); $txt->SetColor( new ColorPt(0.0,1.0,0.0) ); $txt->RefreshAppearance(); $page6->AnnotPushBack( $txt ); - $ink = Ink::Create( $doc->GetSDFDoc(), new Rect( 100.0, 400.0, 200.0, 550.0 ) ); + $ink = Ink::CreateAnnot( $doc->GetSDFDoc(), new Rect( 100.0, 400.0, 200.0, 550.0 ) ); $ink->SetColor( new ColorPt(0.0,0.0,1.0) ); $ink->SetPoint( 1, 3, new Point( 220.0, 505.0) ); $ink->SetPoint( 1, 0, new Point( 100.0, 490.0) ); @@ -480,13 +480,13 @@ function CreateTestAnnots($doc) { $ew->End(); // save changes to the current page $doc->PagePushBack($page7); - $snd = Sound::Create( $doc->GetSDFDoc(), new Rect( 100.0, 500.0, 120.0, 520.0 ) ); + $snd = Sound::CreateAnnot( $doc->GetSDFDoc(), new Rect( 100.0, 500.0, 120.0, 520.0 ) ); $snd->SetColor( new ColorPt(1.0,1.0,0.0) ); $snd->SetIcon( Sound::e_Speaker ); $snd->RefreshAppearance(); $page7->AnnotPushBack( $snd ); - $snd = Sound::Create( $doc->GetSDFDoc(), new Rect( 200.0, 500.0, 220.0, 520.0 ) ); + $snd = Sound::CreateAnnot( $doc->GetSDFDoc(), new Rect( 200.0, 500.0, 220.0, 520.0 ) ); $snd->SetColor( new ColorPt(1.0,1.0,0.0) ); $snd->SetIcon( Sound::e_Mic ); $snd->RefreshAppearance(); @@ -501,7 +501,7 @@ function CreateTestAnnots($doc) { $px = 5; $py = 520; for( $istamp = RubberStamp::e_Approved; $istamp <= RubberStamp::e_Draft; $istamp = $istamp + 1 ) { - $st = RubberStamp::Create( $doc->GetSDFDoc(), new Rect(1.0,1.0,100.0,100.0) ); + $st = RubberStamp::CreateAnnot( $doc->GetSDFDoc(), new Rect(1.0,1.0,100.0,100.0) ); $st->SetIcon( $istamp ); $st->SetContents( $st->GetIconName() ); $st->SetRect( new Rect((double)$px, (double)$py, (double)$px+100.0, (double)$py+25.0 ) ); @@ -520,7 +520,7 @@ function CreateTestAnnots($doc) { } } - $st = RubberStamp::Create( $doc->GetSDFDoc(), new Rect(400.0,5.0,550.0,45.0) ); + $st = RubberStamp::CreateAnnot( $doc->GetSDFDoc(), new Rect(400.0,5.0,550.0,45.0) ); $st->SetIcon( "UserStamp" ); $st->SetContents( "User defined stamp" ); $page8->AnnotPushBack( $st ); @@ -549,8 +549,9 @@ function CreateTestAnnots($doc) { CreateTestAnnots( $doc1 ); $outfname = $output_path."new_annot_test_api.pdf"; $doc1->Save($outfname, SDFDoc::e_linearized); - echo nl2br("Saved new_annot_test_api.pdf\n"); + echo nl2br("Saved new_annot_test_api.pdf"); $doc->Close(); PDFNet::Terminate(); ?> + diff --git a/Samples/AnnotationTest/PYTHON/AnnotationTest.py b/Samples/AnnotationTest/PYTHON/AnnotationTest.py index 4599b145..90526b23 100644 --- a/Samples/AnnotationTest/PYTHON/AnnotationTest.py +++ b/Samples/AnnotationTest/PYTHON/AnnotationTest.py @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/AnnotationTest/RUBY/AnnotationTest.rb b/Samples/AnnotationTest/RUBY/AnnotationTest.rb index e242ad0b..29d4d6f1 100644 --- a/Samples/AnnotationTest/RUBY/AnnotationTest.rb +++ b/Samples/AnnotationTest/RUBY/AnnotationTest.rb @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/BookmarkTest/PHP/BookmarkTest.php b/Samples/BookmarkTest/PHP/BookmarkTest.php index 2d0ff37f..7e3777ce 100644 --- a/Samples/BookmarkTest/PHP/BookmarkTest.php +++ b/Samples/BookmarkTest/PHP/BookmarkTest.php @@ -1,9 +1,9 @@ nul +) +if not exist ..\..\bin\PDFNetC.dll ( + copy ..\..\..\PDFNetC\Lib\PDFNetC.dll ..\..\bin\PDFNetC.dll >nul +) +setlocal +set TEST_NAME=OfficeTemplateTest +go build -o ../../bin/%TEST_NAME%.exe +if %ERRORLEVEL% NEQ 0 goto EOF +call ..\..\bin\%TEST_NAME%.exe +:EOF +endlocal diff --git a/Samples/OfficeTemplateTest/GO/RunTest.sh b/Samples/OfficeTemplateTest/GO/RunTest.sh new file mode 100755 index 00000000..0f4cd3a5 --- /dev/null +++ b/Samples/OfficeTemplateTest/GO/RunTest.sh @@ -0,0 +1,17 @@ +#!/bin/sh +TEST_NAME=OfficeTemplateTest +BIN_PATH="../../bin" + +if [ ! -d $BIN_PATH ] +then + mkdir -p $BIN_PATH +fi + +go build -o $BIN_PATH/$TEST_NAME.exe + +if [ $? -eq 0 ] +then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../../PDFNetC/Lib + $BIN_PATH/$TEST_NAME.exe +fi + diff --git a/Samples/OfficeTemplateTest/PHP/OfficeTemplateTest.php b/Samples/OfficeTemplateTest/PHP/OfficeTemplateTest.php new file mode 100644 index 00000000..cb75b7f9 --- /dev/null +++ b/Samples/OfficeTemplateTest/PHP/OfficeTemplateTest.php @@ -0,0 +1,72 @@ +SetTemplateParamsJson($json); + + // perform the conversion with template delimiters and content dictionary + Convert::OfficeToPDF($pdfdoc, $input_path.$input_filename, $options); + + // save the result + $pdfdoc->Save($output_path.$output_filename, SDFDoc::e_linearized, NULL); + + // And we're done! + echo nl2br("Saved ".$output_filename . "\n"); +} + +main() + +?> diff --git a/Samples/OfficeTemplateTest/PHP/RunTest.bat b/Samples/OfficeTemplateTest/PHP/RunTest.bat new file mode 100644 index 00000000..0f911785 --- /dev/null +++ b/Samples/OfficeTemplateTest/PHP/RunTest.bat @@ -0,0 +1,6 @@ +@echo off +setlocal +set TEST_NAME=OfficeTemplateTest +set PATH=..\..\..\PDFNetC\Lib;%PATH% +php.exe %TEST_NAME%.php +endlocal diff --git a/Samples/OfficeTemplateTest/PHP/RunTest.sh b/Samples/OfficeTemplateTest/PHP/RunTest.sh new file mode 100755 index 00000000..e7d741c2 --- /dev/null +++ b/Samples/OfficeTemplateTest/PHP/RunTest.sh @@ -0,0 +1,4 @@ +#!/bin/sh +TEST_NAME=OfficeTemplateTest +export LD_LIBRARY_PATH=../../../PDFNetC/Lib +php $TEST_NAME.php diff --git a/Samples/OfficeTemplateTest/PYTHON/OfficeTemplateTest.py b/Samples/OfficeTemplateTest/PYTHON/OfficeTemplateTest.py new file mode 100644 index 00000000..71f1179e --- /dev/null +++ b/Samples/OfficeTemplateTest/PYTHON/OfficeTemplateTest.py @@ -0,0 +1,72 @@ +#--------------------------------------------------------------------------------------- +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. +# Consult LICENSE.txt regarding license information. +#--------------------------------------------------------------------------------------- + +import site +site.addsitedir("../../../PDFNetC/Lib") +import sys +from PDFNetPython import * + +sys.path.append("../../LicenseKey/PYTHON") +from LicenseKey import * + +# Relative path to the folder containing the test files. +input_path = "../../TestFiles/" +output_path = "../../TestFiles/Output/" + +#------------------------------------------------------------------------------ +# The following sample illustrates how to use the PDF.Convert utility class +# to convert MS Office files to PDF and replace templated tags present in the document +# with content supplied via json +# +# For a detailed specification of the template format and supported features, +# see: https://www.pdftron.com/documentation/core/guides/generate-via-template/data-model/ +# +# This conversion is performed entirely within the PDFNet and has *no* +# external or system dependencies -- Conversion results will be +# the same whether on Windows, Linux or Android. +# +# Please contact us if you have any questions. +#------------------------------------------------------------------------------ + +def main(): + # The first step in every application using PDFNet is to initialize the + # library. The library is usually initialized only once, but calling + # Initialize() multiple times is also fine. + PDFNet.Initialize(LicenseKey) + PDFNet.SetResourcesPath("../../../Resources") + + input_filename = "SYH_Letter.docx" + output_filename = "SYH_Letter.pdf" + + json = """ + {{ + "dest_given_name": "Janice N.", + "dest_street_address": "187 Duizelstraat", + "dest_surname": "Symonds", + "dest_title": "Ms.", + "land_location": "225 Parc St., Rochelle, QC ", + "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated", + "logo": {{ "image_url": "{0}logo_red.png", "width" : 64, "height": 64 }}, + "sender_name": "Arnold Smith" + }} + """.format(input_path) + + # Start with a PDFDoc (the conversion destination) + pdfdoc = PDFDoc() + + options = OfficeToPDFOptions() + options.SetTemplateParamsJson(json) + + # perform the conversion with template delimiters and content dictionary + Convert.OfficeToPDF(pdfdoc, input_path + input_filename, options) + + # save the result + pdfdoc.Save(output_path + output_filename, SDFDoc.e_linearized) + + # And we're done! + print("Saved " + output_filename ) + +if __name__ == '__main__': + main() diff --git a/Samples/OfficeTemplateTest/PYTHON/RunTest.bat b/Samples/OfficeTemplateTest/PYTHON/RunTest.bat new file mode 100644 index 00000000..b67c1fdf --- /dev/null +++ b/Samples/OfficeTemplateTest/PYTHON/RunTest.bat @@ -0,0 +1,8 @@ +@echo off +setlocal +call ..\..\py_init.bat +if %ERRORLEVEL% NEQ 0 goto EOF +set TEST_NAME=OfficeTemplateTest +python.exe -u %TEST_NAME%.py +:EOF +endlocal diff --git a/Samples/OfficeTemplateTest/PYTHON/RunTest.sh b/Samples/OfficeTemplateTest/PYTHON/RunTest.sh new file mode 100755 index 00000000..14dd3655 --- /dev/null +++ b/Samples/OfficeTemplateTest/PYTHON/RunTest.sh @@ -0,0 +1,5 @@ +#!/bin/sh +TEST_NAME=OfficeTemplateTest +export LD_LIBRARY_PATH=../../../PDFNetC/Lib +. ../../py_init.sh +$python_exe -u $TEST_NAME.py \ No newline at end of file diff --git a/Samples/OfficeTemplateTest/RUBY/OfficeTemplateTest.rb b/Samples/OfficeTemplateTest/RUBY/OfficeTemplateTest.rb new file mode 100644 index 00000000..59d0384f --- /dev/null +++ b/Samples/OfficeTemplateTest/RUBY/OfficeTemplateTest.rb @@ -0,0 +1,72 @@ +#--------------------------------------------------------------------------------------- +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. +# Consult LICENSE.txt regarding license information. +#--------------------------------------------------------------------------------------- + +require '../../../PDFNetC/Lib/PDFNetRuby' +include PDFNetRuby +require '../../LicenseKey/RUBY/LicenseKey' + +$stdout.sync = true + +#------------------------------------------------------------------------------ +# The following sample illustrates how to use the PDF.Convert utility class +# to convert MS Office files to PDF and replace templated tags present in the document +# with content supplied via json +# +# For a detailed specification of the template format and supported features, +# see: https://www.pdftron.com/documentation/core/guides/generate-via-template/data-model/ +# +# This conversion is performed entirely within the PDFNet and has *no* +# external or system dependencies -- Conversion results will be +# the same whether on Windows, Linux or Android. +# +# Please contact us if you have any questions. +#------------------------------------------------------------------------------ + +# Relative path to the folder containing the test files. +$inputPath = "../../TestFiles/" +$outputPath = "../../TestFiles/Output/" + +def main() + # The first step in every application using PDFNet is to initialize the + # library. The library is usually initialized only once, but calling + # Initialize() multiple times is also fine. + PDFNet.Initialize(PDFTronLicense.Key) + PDFNet.SetResourcesPath("../../../Resources") + + inputFilename = "SYH_Letter.docx" + outputFilename = "SYH_Letter.pdf" + + json = ' + { + "dest_given_name": "Janice N.", + "dest_street_address": "187 Duizelstraat", + "dest_surname": "Symonds", + "dest_title": "Ms.", + "land_location": "225 Parc St., Rochelle, QC ", + "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated", + "logo": { "image_url": "%slogo_red.png", "width" : 64, "height": 64 }, + "sender_name": "Arnold Smith" + } + ' % $inputPath + + # Start with a PDFDoc (the conversion destination) + pdfdoc = PDFDoc.new() + + options = OfficeToPDFOptions.new() + options.SetTemplateParamsJson(json) + + # perform the conversion with template delimiters and content dictionary + inputFile = $inputPath + inputFilename + Convert.OfficeToPDF(pdfdoc, inputFile, options) + + # save the result + outputFile = $outputPath + outputFilename + pdfdoc.Save(outputFile, SDFDoc::E_linearized) + + # And we're done! + print("Saved " + outputFilename) +end + +main() diff --git a/Samples/OfficeTemplateTest/RUBY/RunTest.bat b/Samples/OfficeTemplateTest/RUBY/RunTest.bat new file mode 100644 index 00000000..176d35d4 --- /dev/null +++ b/Samples/OfficeTemplateTest/RUBY/RunTest.bat @@ -0,0 +1,6 @@ +@echo off +setlocal +set TEST_NAME=OfficeTemplateTest +SET PATH=..\..\..\PDFNetC\Lib;%PATH% +ruby.exe %TEST_NAME%.rb +endlocal diff --git a/Samples/OfficeTemplateTest/RUBY/RunTest.sh b/Samples/OfficeTemplateTest/RUBY/RunTest.sh new file mode 100755 index 00000000..7474d32d --- /dev/null +++ b/Samples/OfficeTemplateTest/RUBY/RunTest.sh @@ -0,0 +1,4 @@ +#!/bin/sh +TEST_NAME=OfficeTemplateTest +export LD_LIBRARY_PATH=../../../PDFNetC/Lib +ruby $TEST_NAME.rb diff --git a/Samples/OfficeToPDFTest/PHP/OfficeToPDFTest.php b/Samples/OfficeToPDFTest/PHP/OfficeToPDFTest.php index 3e663d6c..08fbed88 100644 --- a/Samples/OfficeToPDFTest/PHP/OfficeToPDFTest.php +++ b/Samples/OfficeToPDFTest/PHP/OfficeToPDFTest.php @@ -1,9 +1,9 @@ getMessage() . "\n")); } @@ -84,7 +84,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to HTML, error: " . $e->getMessage() . "\n")); } @@ -108,7 +108,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to HTML, error: " . $e->getMessage() . "\n")); } diff --git a/Samples/PDF2HtmlTest/PYTHON/PDF2HtmlTest.py b/Samples/PDF2HtmlTest/PYTHON/PDF2HtmlTest.py index 3983b0dd..cc495dff 100644 --- a/Samples/PDF2HtmlTest/PYTHON/PDF2HtmlTest.py +++ b/Samples/PDF2HtmlTest/PYTHON/PDF2HtmlTest.py @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDF2HtmlTest/RUBY/PDF2HtmlTest.rb b/Samples/PDF2HtmlTest/RUBY/PDF2HtmlTest.rb index 6f72739e..f691093f 100644 --- a/Samples/PDF2HtmlTest/RUBY/PDF2HtmlTest.rb +++ b/Samples/PDF2HtmlTest/RUBY/PDF2HtmlTest.rb @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDF2OfficeTest/PHP/PDF2OfficeTest.php b/Samples/PDF2OfficeTest/PHP/PDF2OfficeTest.php index 6ccd16b7..365def3e 100644 --- a/Samples/PDF2OfficeTest/PHP/PDF2OfficeTest.php +++ b/Samples/PDF2OfficeTest/PHP/PDF2OfficeTest.php @@ -1,9 +1,9 @@ getMessage() . "\n")); } @@ -82,7 +82,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to Word, error: " . $e->getMessage() . "\n")); } @@ -98,7 +98,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to Excel, error: " . $e->getMessage() . "\n")); } @@ -119,7 +119,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to Excel, error: " . $e->getMessage() . "\n")); } @@ -135,7 +135,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to PowerPoint, error: " . $e->getMessage() . "\n")); } @@ -156,7 +156,7 @@ function main() echo(nl2br("Result saved in " . $outputFile . "\n")); } - catch(\Exception $e) { + catch(Exception $e) { echo(nl2br("Unable to convert PDF document to PowerPoint, error: " . $e->getMessage() . "\n")); } diff --git a/Samples/PDF2OfficeTest/PYTHON/PDF2OfficeTest.py b/Samples/PDF2OfficeTest/PYTHON/PDF2OfficeTest.py index dd3b509c..23f7c31b 100644 --- a/Samples/PDF2OfficeTest/PYTHON/PDF2OfficeTest.py +++ b/Samples/PDF2OfficeTest/PYTHON/PDF2OfficeTest.py @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDF2OfficeTest/RUBY/PDF2OfficeTest.rb b/Samples/PDF2OfficeTest/RUBY/PDF2OfficeTest.rb index 15f56811..6deec18f 100644 --- a/Samples/PDF2OfficeTest/RUBY/PDF2OfficeTest.rb +++ b/Samples/PDF2OfficeTest/RUBY/PDF2OfficeTest.rb @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDFATest/PHP/PDFATest.php b/Samples/PDFATest/PHP/PDFATest.php index 6a75d511..dd4078d4 100644 --- a/Samples/PDFATest/PHP/PDFATest.php +++ b/Samples/PDFATest/PHP/PDFATest.php @@ -1,9 +1,9 @@ GetOCGConfig(); if (!$cfg->IsValid()) { - $cfg = Config::Create($doc, true); + $cfg = OCGConfig::Create($doc, true); $cfg->SetName("Default"); } diff --git a/Samples/PDFLayersTest/PYTHON/PDFLayersTest.py b/Samples/PDFLayersTest/PYTHON/PDFLayersTest.py index 568a6380..2a060b5b 100644 --- a/Samples/PDFLayersTest/PYTHON/PDFLayersTest.py +++ b/Samples/PDFLayersTest/PYTHON/PDFLayersTest.py @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDFLayersTest/RUBY/PDFLayersTest.rb b/Samples/PDFLayersTest/RUBY/PDFLayersTest.rb index e9d05f04..89088cc7 100644 --- a/Samples/PDFLayersTest/RUBY/PDFLayersTest.rb +++ b/Samples/PDFLayersTest/RUBY/PDFLayersTest.rb @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/PDFPackageTest/PHP/PDFPackageTest.php b/Samples/PDFPackageTest/PHP/PDFPackageTest.php index 73f6935a..4b831040 100644 --- a/Samples/PDFPackageTest/PHP/PDFPackageTest.php +++ b/Samples/PDFPackageTest/PHP/PDFPackageTest.php @@ -1,9 +1,9 @@ GetSDFDoc(), $font_program, true, true); } - catch(\Exception $e){ + catch(Exception $e){ } if($fnt) diff --git a/Samples/UnicodeWriteTest/PYTHON/UnicodeWriteTest.py b/Samples/UnicodeWriteTest/PYTHON/UnicodeWriteTest.py index 83b04863..e151a010 100644 --- a/Samples/UnicodeWriteTest/PYTHON/UnicodeWriteTest.py +++ b/Samples/UnicodeWriteTest/PYTHON/UnicodeWriteTest.py @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb b/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb index e399816c..3a114ed7 100644 --- a/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb +++ b/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb @@ -1,5 +1,5 @@ #--------------------------------------------------------------------------------------- -# Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved. +# Copyright (c) 2001-2022 by PDFTron Systems Inc. All Rights Reserved. # Consult LICENSE.txt regarding license information. #--------------------------------------------------------------------------------------- diff --git a/Samples/WebViewerConvertTest/PHP/WebViewerConvertTest.php b/Samples/WebViewerConvertTest/PHP/WebViewerConvertTest.php index 2c3189f7..df17b677 100644 --- a/Samples/WebViewerConvertTest/PHP/WebViewerConvertTest.php +++ b/Samples/WebViewerConvertTest/PHP/WebViewerConvertTest.php @@ -1,9 +1,9 @@