deri pushed a commit to branch master
in repository groff.

commit 50710477cd2530fb4e1097e6982425e302a48fdd
Author: Deri James <[email protected]>
AuthorDate: Tue Nov 4 17:50:25 2025 +0000

    [gropdf]: Problem including pdfs produced by ghostscript 10
    
    * src/devices/gropdf/gropdf.pl (ParsePDFValue): Improve parser
    to handle multiple "/key/value" on one line.
---
 ChangeLog                    | 7 +++++++
 src/devices/gropdf/gropdf.pl | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 593ba2714..c8bd0e14d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-11-04  Deri James  <[email protected]>
+
+       [gropdf]: Problem including pdfs produced by ghostscript 10
+
+       * src/devices/gropdf/gropdf.pl (ParsePDFValue): Improve parser
+       to handle multiple "/key/value" on one line.
+
 2025-11-04  Deri James  <[email protected]>
 
        [gropdf]: Document --opt and --pdfver
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 28f41527a..048a607fb 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -3054,7 +3054,7 @@ sub ParsePDFValue
     my $rtn;
     my $wd=nextwd($pdfwds);
 
-    if ($wd=~m/^\d+$/ and $pdfwds->[0]=~m/^\d+$/ and 
$pdfwds->[1]=~m/^R(\]|\>|\/)?/)
+    if ($wd=~m/^\d+$/ and $#{$pdfwds}>0 and $pdfwds->[0]=~m/^\d+$/ and 
$pdfwds->[1]=~m/^R(\]|\>|\/)?/)
     {
        shift(@{$pdfwds});
        if (defined($1) and length($1))
@@ -3113,6 +3113,12 @@ sub ParsePDFValue
        }
     }
 
+    if ($wd=~m/(\/.+?)(\/.*)$/)
+    {
+       unshift(@{$pdfwds},$2);
+       $wd=$1;
+    }
+
     return($wd);
 }
 

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to