On Fri, Jun 19, 2020 at 12:50 PM Jonas Hahnfeld <hah...@hahnjo.de> wrote:
> No changes for me. Please also keep in mind that the same command
> string works via the API interpreter. It could be that this is related
> to processing other files before the "empty" one...
> I'll try to write a small wrapper around the API so we can test outside
> of LilyPond what actually triggers the broken PDF.

Your hunch is correct. No need to write a wrapper, the following in a
.ly file works if you replace SCM_UNDEFINED with SCM_UNSPECIFIED in
ly:gs-api

(r.eps is a random EPS file that I had lying around.)

#(ly:gs-api
  '("gs" "-dEPSCrop" "-dNODISPLAY" "-dNOSAFER" "-dNOPAUSE" "-dBATCH"
           "-dAutoRotatePages=/None" "-dPrinted=false")
  "mark /OutputFile (broken1.pdf)
(pdfwrite) finddevice putdeviceprops setdevice
(broken.eps) run")

#(ly:gs-api
  '("gs" "-dEPSCrop" "-dNODISPLAY" "-dNOSAFER" "-dNOPAUSE" "-dBATCH"
    "-dAutoRotatePages=/None" "-dPrinted=false")
  "mark /OutputFile (r.pdf)
(pdfwrite) finddevice putdeviceprops setdevice
(r.eps) run")

#(ly:gs-api
  '("gs" "-dEPSCrop" "-dNODISPLAY" "-dNOSAFER" "-dNOPAUSE" "-dBATCH"
           "-dAutoRotatePages=/None" "-dPrinted=false")
  "mark /OutputFile (broken2.pdf)
(pdfwrite) finddevice putdeviceprops setdevice
(broken.eps) run")


[hanwen@t460-wlan lilypond]$ qpdf --qdf --object-streams=disable
broken2.pdf /dev/stdout  | grep Contents
  /Contents 7 0 R
%% Contents for page 1
[hanwen@t460-wlan lilypond]$ qpdf --qdf --object-streams=disable
broken1.pdf /dev/stdout  | grep Contents

This does present a quandary, because we'd either have to find
configuration that causes the problem to go away, or we have to modify
the string we're executing if we're not using the API.

But the latter undoes the benefit of unifying the API and CLI.


-- 
Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen

  • Re: xdvipdfmx fails... Werner LEMBERG
  • Re: xdvipdfmx fails... Jonas Hahnfeld via Discussions on LilyPond development
    • Re: xdvipdfmx ... Carl Sorensen
      • Re: xdvipd... Jonas Hahnfeld via Discussions on LilyPond development
        • Re: xd... Han-Wen Nienhuys
          • Re... Jonas Hahnfeld via Discussions on LilyPond development
            • ... David Kastrup
            • ... Han-Wen Nienhuys
            • ... Jonas Hahnfeld via Discussions on LilyPond development
            • ... Han-Wen Nienhuys
            • ... Han-Wen Nienhuys
            • ... Han-Wen Nienhuys
            • ... Jonas Hahnfeld via Discussions on LilyPond development
            • ... Jonas Hahnfeld via Discussions on LilyPond development
            • ... Jonas Hahnfeld via Discussions on LilyPond development
            • ... Han-Wen Nienhuys
            • ... Jonas Hahnfeld via Discussions on LilyPond development
            • ... Michael Käppler
            • ... David Kastrup
            • ... Han-Wen Nienhuys
            • ... David Kastrup

Reply via email to