discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

simple-pdf export test

JB
Jordan Brown
Fri, Jun 11, 2021 5:38 AM

Is anybody familiar with PDF export, and in particular with the
simple-pdf test?

Here's the setup...

I have Windows builds before and after my changes.

I have Ubuntu builds before and after my changes.

The test passes on both platforms when run against the "before" build.

It is expected that the test would fail with my changes, because they
change the spacing of OpenSCAD-rendered text.  I updated the reference
image on the Windows system based on the new actual result, and (of
course) the test now passes on the "after" Windows build.

I test the "after" build on Ubuntu with that revised reference image,
and it fails.

That's undesirable and unexpected, of course, but it's what tests do and
now I need to figure out why there's a difference.

Now the puzzle...

On Ubuntu, I compare the "before" reference image with the "before"
actual image, and there are considerable differences. The "Scale is to
calibrate" note along the bottom is significantly longer on the
before-actual image than it is on the before-reference image.  On the
before-reference image, that note extends to about 83 on that scale,
while on the before-actual image it extends to about 94.  And yet the
test passes.

On the other hand, I compare the "after" reference image (from the
Windows build) with the "after" actual image, and the differences are
basically the same as they are for before-reference vs before-actual...
but the test fails.  There do not appear to be any differences in the
OpenSCAD-rendered portion of the image, the stuff that I changed - only
in the labels along the axes.

The PDF files generated on Ubuntu are very different from the PDF files
generated on Windows, but there are no reference PDFs so I can't
directly say which is "right", if either is.

My only guess is that either Cairo or GhostScript is different enough
between the two platforms to produce different results, and the results
are different enough to pass some difference limit that wasn't being
passed with the original image.

Anybody have any ideas?  I can supply all of the images if that would be
helpful.

Is anybody familiar with PDF export, and in particular with the simple-pdf test? Here's the setup... I have Windows builds before and after my changes. I have Ubuntu builds before and after my changes. The test passes on both platforms when run against the "before" build. It is expected that the test would fail with my changes, because they change the spacing of OpenSCAD-rendered text.  I updated the reference image on the Windows system based on the new actual result, and (of course) the test now passes on the "after" Windows build. I test the "after" build on Ubuntu with that revised reference image, and it fails. That's undesirable and unexpected, of course, but it's what tests do and now I need to figure out why there's a difference. Now the puzzle... On Ubuntu, I compare the "before" reference image with the "before" actual image, and there are considerable differences. The "Scale is to calibrate" note along the bottom is significantly longer on the before-actual image than it is on the before-reference image.  On the before-reference image, that note extends to about 83 on that scale, while on the before-actual image it extends to about 94.  And yet the test passes. On the other hand, I compare the "after" reference image (from the Windows build) with the "after" actual image, and the differences are basically the same as they are for before-reference vs before-actual... but the test fails.  There do not appear to be *any* differences in the OpenSCAD-rendered portion of the image, the stuff that I changed - only in the labels along the axes. The PDF files generated on Ubuntu are very different from the PDF files generated on Windows, but there are no reference PDFs so I can't directly say which is "right", if either is. My only guess is that either Cairo or GhostScript is different enough between the two platforms to produce different results, and the results are different enough to pass some difference limit that wasn't being passed with the original image. Anybody have any ideas?  I can supply all of the images if that would be helpful.
JB
Jordan Brown
Fri, Jun 11, 2021 5:47 AM

I should perhaps mention:

Windows

  • mingw-w64-x86_64-ghostscript 9.53.3-1
  • mingw-w64-x86_64-cairo 1.17.4-2

Ubuntu

  • ghostscript 9.53.3~dfsg-7
  • libcairo2 1.16.0-5ubuntu1
I should perhaps mention: Windows * mingw-w64-x86_64-ghostscript 9.53.3-1 * mingw-w64-x86_64-cairo 1.17.4-2 Ubuntu * ghostscript 9.53.3~dfsg-7 * libcairo2 1.16.0-5ubuntu1
T
Troberg
Sat, Jun 12, 2021 10:40 AM

While we are on the subject of PDF expoer, I would love a "clean" export,
pretty much the same as the svg export.

That would help me immensely, as I have a project where I frequently export
a shitload of svg files, then has to convert them all to pdf before joining
them to a single pdf. This process currently takes 15 hours, and as the
number of files increase, the time will also. If I could skip the conversion
stage, I would cut that time in half, as well as not locking up the computer
during the process.

--
Sent from: http://forum.openscad.org/

While we are on the subject of PDF expoer, I would love a "clean" export, pretty much the same as the svg export. That would help me immensely, as I have a project where I frequently export a shitload of svg files, then has to convert them all to pdf before joining them to a single pdf. This process currently takes 15 hours, and as the number of files increase, the time will also. If I could skip the conversion stage, I would cut that time in half, as well as not locking up the computer during the process. -- Sent from: http://forum.openscad.org/
WF
William F. Adams
Sat, Jun 12, 2021 1:10 PM

How are you doing the conversion?
Couldn't you just automate the conversion and concatenation using a tool such as pdftex?
If you'd send me a set of files incl. a PDF (or just the filenames) and a note on the order I'll gladly work up a file for this.
William

-----Original Message-----
From: Troberg troberg.anders@gmail.com
To: discuss@lists.openscad.org
Sent: Sat, Jun 12, 2021 6:40 am
Subject: [OpenSCAD] Re: simple-pdf export test

While we are on the subject of PDF expoer, I would love a "clean" export, pretty much the same as the svg export.

That would help me immensely, as I have a project where I frequently export a shitload of svg files, then has to convert them all to pdf before joining them to a single pdf. This process currently takes 15 hours, and as the number of files increase, the time will also. If I could skip the conversion stage, I would cut that time in half, as well as not locking up the computer during the process.
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

How are you doing the conversion? Couldn't you just automate the conversion and concatenation using a tool such as pdftex? If you'd send me a set of files incl. a PDF (or just the filenames) and a note on the order I'll gladly work up a file for this. William -----Original Message----- From: Troberg <troberg.anders@gmail.com> To: discuss@lists.openscad.org Sent: Sat, Jun 12, 2021 6:40 am Subject: [OpenSCAD] Re: simple-pdf export test While we are on the subject of PDF expoer, I would love a "clean" export, pretty much the same as the svg export. That would help me immensely, as I have a project where I frequently export a shitload of svg files, then has to convert them all to pdf before joining them to a single pdf. This process currently takes 15 hours, and as the number of files increase, the time will also. If I could skip the conversion stage, I would cut that time in half, as well as not locking up the computer during the process. Sent from the OpenSCAD mailing list archive at Nabble.com. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Mon, Jun 14, 2021 6:13 AM

More data:

On both Windows and Ubuntu, I ran the test before and after my changes.

On both platforms, the differences between the before and after runs are
exactly what I expect:  the OpenSCAD-rendered text is spaced
differently.  The axes and their labels are exactly identical between
the two runs.

So, minor mystery #1:  Why is the Ubuntu result different from the
Windows result?  (My guesses: either the different versions of cairo, or
different font availability.)
And bigger mystery #2:  Why does the test succeed on the "before"
results on both platforms, and the Ubuntu run fails on the "after" runs
when using the Windows image as the golden copy?

And of course that leads into the problem that I really need to solve: 
how do I make the test happy?
Troberg hints at one possible answer:  change the PDF export to
optionally include the axes and labels, and have the test use images
that don't include them.

Anybody know?

More data: On both Windows and Ubuntu, I ran the test before and after my changes. On both platforms, the differences between the before and after runs are exactly what I expect:  the OpenSCAD-rendered text is spaced differently.  The axes and their labels are exactly identical between the two runs. So, minor mystery #1:  Why is the Ubuntu result different from the Windows result?  (My guesses: either the different versions of cairo, or different font availability.) And bigger mystery #2:  Why does the test succeed on the "before" results on both platforms, and the Ubuntu run fails on the "after" runs when using the Windows image as the golden copy? And of course that leads into the problem that I really need to solve:  how do I make the test happy? Troberg hints at one possible answer:  change the PDF export to optionally include the axes and labels, and have the test use images that don't include them. Anybody know?