From 097c5c6916e64cae78110e5beff63435a2385013 Mon Sep 17 00:00:00 2001 From: Rainer Schaaf Date: Sun, 7 Dec 2025 11:08:50 +0100 Subject: [PATCH 1/3] cmake 4 compatibility. --- PDFNetPHP/CMakeLists.txt | 11 ++++++++++- PDFNetRuby/CMakeLists.txt | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/PDFNetPHP/CMakeLists.txt b/PDFNetPHP/CMakeLists.txt index 25226189..fa244abf 100644 --- a/PDFNetPHP/CMakeLists.txt +++ b/PDFNetPHP/CMakeLists.txt @@ -3,8 +3,17 @@ # Consult LICENSE.txt for licensing information. #----------------------------------------------------------------------------------------------------------------------- +if(CMAKE_MAJOR_VERSION VERSION_EQUAL "4") + cmake_minimum_required(VERSION 3.10) +else() + cmake_minimum_required(VERSION 3.4) +endif() + +if (APPLE) + set(CMAKE_OSX_ARCHITECTURES arm64 x86_64) +endif() + project(PDFNetPHP CXX) -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) find_program(PHP_CONFIG_EXECUTABLE NAMES php-config7 php-config5 php-config4 php-config) diff --git a/PDFNetRuby/CMakeLists.txt b/PDFNetRuby/CMakeLists.txt index 0c09c05f..faf85e9a 100644 --- a/PDFNetRuby/CMakeLists.txt +++ b/PDFNetRuby/CMakeLists.txt @@ -3,8 +3,17 @@ # Consult LICENSE.txt for licensing information. #----------------------------------------------------------------------------------------------------------------------- +if(CMAKE_MAJOR_VERSION VERSION_EQUAL "4") + cmake_minimum_required(VERSION 3.10) +else() + cmake_minimum_required(VERSION 3.4) +endif() + +if (APPLE) + set(CMAKE_OSX_ARCHITECTURES arm64 x86_64) +endif() + project(PDFNetRuby CXX) -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) # Checks the header and library directory of the current active ruby install # This will respond to virtual enviroments From 65e05bb5ed7a3268395c36b41fd9c62c1a5f621f Mon Sep 17 00:00:00 2001 From: Rainer Schaaf Date: Mon, 8 Dec 2025 16:54:12 +0100 Subject: [PATCH 2/3] add 'x' (executable) bit for RunTest.sh some of the RunTest.sh shell scripts missed the 'x'-bit. --- Samples/AdvancedImagingTest/PHP/RunTest.sh | 0 Samples/AdvancedImagingTest/RUBY/RunTest.sh | 0 Samples/BarcodeTest/PHP/RunTest.sh | 0 Samples/BarcodeTest/RUBY/RunTest.sh | 0 Samples/CAD2PDFTest/PHP/RunTest.sh | 0 Samples/CAD2PDFTest/RUBY/RunTest.sh | 0 Samples/DataExtractionTest/PHP/RunTest.sh | 0 Samples/DataExtractionTest/RUBY/RunTest.sh | 0 Samples/ElementReaderTest/PHP/RunTest.sh | 0 Samples/ElementReaderTest/RUBY/RunTest.sh | 0 Samples/OCRTest/PHP/RunTest.sh | 0 Samples/OCRTest/RUBY/RunTest.sh | 0 Samples/OfficeToPDFTest/PHP/RunTest.sh | 0 Samples/OfficeToPDFTest/RUBY/RunTest.sh | 0 Samples/PDFUATest/PHP/RunTest.sh | 0 Samples/PDFUATest/RUBY/RunTest.sh | 0 Samples/UndoRedoTest/PHP/RunTest.sh | 0 Samples/UndoRedoTest/RUBY/RunTest.sh | 0 18 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Samples/AdvancedImagingTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/AdvancedImagingTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/BarcodeTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/BarcodeTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/CAD2PDFTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/CAD2PDFTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/DataExtractionTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/DataExtractionTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/ElementReaderTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/ElementReaderTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/OCRTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/OCRTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/OfficeToPDFTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/OfficeToPDFTest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/PDFUATest/PHP/RunTest.sh mode change 100644 => 100755 Samples/PDFUATest/RUBY/RunTest.sh mode change 100644 => 100755 Samples/UndoRedoTest/PHP/RunTest.sh mode change 100644 => 100755 Samples/UndoRedoTest/RUBY/RunTest.sh diff --git a/Samples/AdvancedImagingTest/PHP/RunTest.sh b/Samples/AdvancedImagingTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/AdvancedImagingTest/RUBY/RunTest.sh b/Samples/AdvancedImagingTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/BarcodeTest/PHP/RunTest.sh b/Samples/BarcodeTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/BarcodeTest/RUBY/RunTest.sh b/Samples/BarcodeTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/CAD2PDFTest/PHP/RunTest.sh b/Samples/CAD2PDFTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/CAD2PDFTest/RUBY/RunTest.sh b/Samples/CAD2PDFTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/DataExtractionTest/PHP/RunTest.sh b/Samples/DataExtractionTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/DataExtractionTest/RUBY/RunTest.sh b/Samples/DataExtractionTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/ElementReaderTest/PHP/RunTest.sh b/Samples/ElementReaderTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/ElementReaderTest/RUBY/RunTest.sh b/Samples/ElementReaderTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/OCRTest/PHP/RunTest.sh b/Samples/OCRTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/OCRTest/RUBY/RunTest.sh b/Samples/OCRTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/OfficeToPDFTest/PHP/RunTest.sh b/Samples/OfficeToPDFTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/OfficeToPDFTest/RUBY/RunTest.sh b/Samples/OfficeToPDFTest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/PDFUATest/PHP/RunTest.sh b/Samples/PDFUATest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/PDFUATest/RUBY/RunTest.sh b/Samples/PDFUATest/RUBY/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/UndoRedoTest/PHP/RunTest.sh b/Samples/UndoRedoTest/PHP/RunTest.sh old mode 100644 new mode 100755 diff --git a/Samples/UndoRedoTest/RUBY/RunTest.sh b/Samples/UndoRedoTest/RUBY/RunTest.sh old mode 100644 new mode 100755 From 6f479084b1d9c376b28b24e4697ee9c03399bb28 Mon Sep 17 00:00:00 2001 From: Rainer Schaaf Date: Mon, 8 Dec 2025 20:56:39 +0100 Subject: [PATCH 3/3] make ElementBuilderTest.rb and UnicodeWriteTest.rb tests more robust --- Samples/ElementBuilderTest/RUBY/ElementBuilderTest.rb | 4 ++-- Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Samples/ElementBuilderTest/RUBY/ElementBuilderTest.rb b/Samples/ElementBuilderTest/RUBY/ElementBuilderTest.rb index 09ee079e..823efa31 100644 --- a/Samples/ElementBuilderTest/RUBY/ElementBuilderTest.rb +++ b/Samples/ElementBuilderTest/RUBY/ElementBuilderTest.rb @@ -252,9 +252,9 @@ cur_width = 0 while text_run < para_end do - text_run_end = para.index(' ', text_run) + text_run_end = para.index(' ', text_run.to_i) - if text_run_end == nil + if text_run_end.nil? text_run_end = para_end - 1 end diff --git a/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb b/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb index b8531dd0..877f9abd 100644 --- a/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb +++ b/Samples/UnicodeWriteTest/RUBY/UnicodeWriteTest.rb @@ -42,7 +42,7 @@ def main() # Embed and subset the font font_program = $input_path + "ARIALUNI.TTF" if not File.file?(font_program) - if ENV['OS'] == "Windows_NT" + if ENV['OS'] && ENV['OS'] == "Windows_NT" font_program = "C:/Windows/Fonts/ARIALUNI.TTF" puts "Note: Using ARIALUNI.TTF from C:/Windows/Fonts directory." end