ChordPro / chordpro

Reference implementation of the ChordPro standard for musical lead sheets.
Other
310 stars 51 forks source link

textblock background causes invalid (but functional) PDF #411

Open gwyndaf opened 1 month ago

gwyndaf commented 1 month ago

No practical impact on output but, when I put ChordPro PDF output through ghostscript (to add/reinstate hyperlinks), I get a PDF validity error:

The following warnings were encountered at least once while processing this file:
    invalid operator used in text block

   **** This file had errors that were repaired or ignored.
   **** The file was produced by: 
   **** >>>> PDF::API2 2.047 (linux) <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

Sample PDF is Make_Me_Feel_Again.pdf using default config from Make_Me_Feel_Again.cho.txt

I think I've narrowed it down to the textblock:

{start_of_textblock-guitar: id="introtab" textstyle="tab" textspacing=0.9 padding=3 border=0.25 background=#cccccc}

Specifically, if I remove the background setting, the problem goes away.

No such problem for an ABC score using %%bgcolor #f8f8f8, so I don't think it's backgrounds in general, but maybe something to do with how the textblock background get written to PDF, and possibly a PDF::API2 issue rather than ChordPro.