discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: simple-pdf export test

T
Troberg
Sun, Jun 13, 2021 10:15 AM

OpenSCAD mailing list-2 wrote

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.

I do it by batching InkScape.

I'll take a look at pdftex and see if that is workable. But, still, I like
to have as short a tool chain as possible.

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

OpenSCAD mailing list-2 wrote > 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. I do it by batching InkScape. I'll take a look at pdftex and see if that is workable. But, still, I like to have as short a tool chain as possible. -- Sent from: http://forum.openscad.org/
A
adrianv
Sun, Jun 13, 2021 1:27 PM

I didn't really think too carefully about this when you posted it originally,
but 15 hours!  You said you had a lot of files, but not how many you mean,
Is it fifty thousand files?  Because 15 hours seems extremely long.  Where
is the time going?

I also don't understand the desire to keep the tool chain short.  Are you
using Windows?  Under unix part of the point is that the tools do their one
job and you use a lot of them if necessary.  I'd say you should use how
ever many tools enable you to complete the task efficiently, and it sounds
like your current setup isn't doing the job.

I concat pdf files with pdftk but I'm not sure how that compares to using
pdftex.  I just concated 12 copies of a 300 kB pdf and it runs instantly.  I
can't imagine how big your pdf would be for the pdf concatenation step to be
nontrivial in time.

Actually I looked up pdftex and it doesn't appear that it has a method for
concatenating pdf files.  People talk of writing a TeX file that imports all
the pdfs.  I suppose that could be a good solution if you really want to
pack multiple pdf files onto one page.  I was assuming one page per pdf.
But using TeX to concatenate pdf files seems unlikely to be the best
solution to the plain pdf concatenation problem.  It will surely be slower
than pdftk.

If inkscape is taking 7 hours to convert to pdf I'd consider whether there's
a better alternative, unless you do have tends of thousands of files.  So
perhaps:
https://itectec.com/superuser/how-to-convert-an-svg-to-a-pdf-on-linux/

Troberg wrote

OpenSCAD mailing list-2 wrote

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.

I do it by batching InkScape.

I'll take a look at pdftex and see if that is workable. But, still, I like
to have as short a tool chain as possible.

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


OpenSCAD mailing list
To unsubscribe send an email to

discuss-leave@.openscad

I didn't really think too carefully about this when you posted it originally, but 15 hours! You said you had a lot of files, but not how many you mean, Is it fifty thousand files? Because 15 hours seems extremely long. Where is the time going? I also don't understand the desire to keep the tool chain short. Are you using Windows? Under unix part of the point is that the tools do their one job and you use a lot of them if necessary. I'd say you should use how ever many tools enable you to complete the task efficiently, and it sounds like your current setup isn't doing the job. I concat pdf files with pdftk but I'm not sure how that compares to using pdftex. I just concated 12 copies of a 300 kB pdf and it runs instantly. I can't imagine how big your pdf would be for the pdf concatenation step to be nontrivial in time. Actually I looked up pdftex and it doesn't appear that it has a method for concatenating pdf files. People talk of writing a TeX file that imports all the pdfs. I suppose that could be a good solution if you really want to pack multiple pdf files onto one page. I was assuming one page per pdf. But using TeX to concatenate pdf files seems unlikely to be the best solution to the plain pdf concatenation problem. It will surely be slower than pdftk. If inkscape is taking 7 hours to convert to pdf I'd consider whether there's a better alternative, unless you do have tends of thousands of files. So perhaps: https://itectec.com/superuser/how-to-convert-an-svg-to-a-pdf-on-linux/ Troberg wrote > OpenSCAD mailing list-2 wrote >> 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. > > I do it by batching InkScape. > > I'll take a look at pdftex and see if that is workable. But, still, I like > to have as short a tool chain as possible. > > > > -- > Sent from: http://forum.openscad.org/ > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to > discuss-leave@.openscad -- Sent from: http://forum.openscad.org/
WF
William F. Adams
Sun, Jun 13, 2021 7:13 PM

pdftk is convenient for concatenation and basic operations --- pdftex is a lot more flexible and capable, offering the option of putting multiple graphics on a single page, or adding them one per page to the document.
It also has a shell-escape mechanism for converting graphics, and there is a package for directly importing an SVG:
https://www.ctan.org/tex-archive/graphics/svg
I've also found pdftex to be faster than pdftk for some operations.
Lastly, it might be worth looking into using lualatex.
William

-----Original Message-----
From: adrianv avm4@cornell.edu
To: discuss@lists.openscad.org
Sent: Sun, Jun 13, 2021 9:27 am
Subject: [OpenSCAD] Re: simple-pdf export test

I didn't really think too carefully about this when you posted it originally, but 15 hours!  You said you had a lot of files, but not how many you mean,   Is it fifty thousand files?   Because 15 hours seems extremely long.   Where is the time going?

I also don't understand the desire to keep the tool chain short.   Are you using Windows?  Under unix part of the point is that the tools do their one job and you use a lot of them if necessary.   I'd say you should use how ever many tools enable you to complete the task efficiently, and it sounds like your current setup isn't doing the job.  

I concat pdf files with pdftk but I'm not sure how that compares to using pdftex.  I just concated 12 copies of a 300 kB pdf and it runs instantly.  I can't imagine how big your pdf would be for the pdf concatenation step to be nontrivial in time.

Actually I looked up pdftex and it doesn't appear that it has a method for concatenating pdf files.  People talk of writing a TeX file that imports all the pdfs.  I suppose that could be a good solution if you really want to pack multiple pdf files onto one page.  I was assuming one page per pdf.  But using TeX to concatenate pdf files seems unlikely to be the best solution to the plain pdf concatenation problem.  It will surely be slower than pdftk.  

If inkscape is taking 7 hours to convert to pdf I'd consider whether there's a better alternative, unless you do have tends of thousands of files.   So perhaps:
https://itectec.com/superuser/how-to-convert-an-svg-to-a-pdf-on-linux/

Troberg wroteOpenSCAD mailing list-2 wrote

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.

I do it by batching InkScape.

I'll take a look at pdftex and see if that is workable. But, still, I like
to have as short a tool chain as possible.

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


OpenSCAD mailing list
To unsubscribe send an email to [hidden email]

Sent from the OpenSCAD mailing list archive at Nabble.com.


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

pdftk is convenient for concatenation and basic operations --- pdftex is a lot more flexible and capable, offering the option of putting multiple graphics on a single page, or adding them one per page to the document. It also has a shell-escape mechanism for converting graphics, and there is a package for directly importing an SVG: https://www.ctan.org/tex-archive/graphics/svg I've also found pdftex to be faster than pdftk for some operations. Lastly, it might be worth looking into using lualatex. William -----Original Message----- From: adrianv <avm4@cornell.edu> To: discuss@lists.openscad.org Sent: Sun, Jun 13, 2021 9:27 am Subject: [OpenSCAD] Re: simple-pdf export test I didn't really think too carefully about this when you posted it originally, but 15 hours!  You said you had a lot of files, but not how many you mean,   Is it fifty thousand files?   Because 15 hours seems extremely long.   Where is the time going? I also don't understand the desire to keep the tool chain short.   Are you using Windows?  Under unix part of the point is that the tools do their one job and you use a lot of them if necessary.   I'd say you should use how ever many tools enable you to complete the task efficiently, and it sounds like your current setup isn't doing the job.   I concat pdf files with pdftk but I'm not sure how that compares to using pdftex.  I just concated 12 copies of a 300 kB pdf and it runs instantly.  I can't imagine how big your pdf would be for the pdf concatenation step to be nontrivial in time. Actually I looked up pdftex and it doesn't appear that it has a method for concatenating pdf files.  People talk of writing a TeX file that imports all the pdfs.  I suppose that could be a good solution if you really want to pack multiple pdf files onto one page.  I was assuming one page per pdf.  But using TeX to concatenate pdf files seems unlikely to be the best solution to the plain pdf concatenation problem.  It will surely be slower than pdftk.   If inkscape is taking 7 hours to convert to pdf I'd consider whether there's a better alternative, unless you do have tends of thousands of files.   So perhaps: https://itectec.com/superuser/how-to-convert-an-svg-to-a-pdf-on-linux/ Troberg wroteOpenSCAD mailing list-2 wrote > 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. I do it by batching InkScape. I'll take a look at pdftex and see if that is workable. But, still, I like to have as short a tool chain as possible. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to [hidden email] Sent from the OpenSCAD mailing list archive at Nabble.com. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
T
Troberg
Mon, Jun 14, 2021 7:20 AM

adrianv wrote

I didn't really think too carefully about this when you posted it
originally,
but 15 hours!  You said you had a lot of files, but not how many you mean,
Is it fifty thousand files?  Because 15 hours seems extremely long.
Where
is the time going?

Around 5000. Most of the time is spend in rendering and converting to PDF,
and most of that time is probably in loading OpenSCAD and InkScape for each
file. I do some other stuff as well, such as sorting, concatenating and
fixing file formats, but that's less than 5 minutes.

adrianv wrote

I also don't understand the desire to keep the tool chain short.  Are you
using Windows?  Under unix part of the point is that the tools do their
one
job and you use a lot of them if necessary.  I'd say you should use how
ever many tools enable you to complete the task efficiently, and it sounds
like your current setup isn't doing the job.

Windows, my Linux machines don't have the hardware to do this anywhere near
as fast. The reason I want the toolchain short is that one day, I'll run
this on another machine, and it'll make it much easier to get it running
again.

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

adrianv wrote > I didn't really think too carefully about this when you posted it > originally, > but 15 hours! You said you had a lot of files, but not how many you mean, > Is it fifty thousand files? Because 15 hours seems extremely long. > Where > is the time going? Around 5000. Most of the time is spend in rendering and converting to PDF, and most of that time is probably in loading OpenSCAD and InkScape for each file. I do some other stuff as well, such as sorting, concatenating and fixing file formats, but that's less than 5 minutes. adrianv wrote > I also don't understand the desire to keep the tool chain short. Are you > using Windows? Under unix part of the point is that the tools do their > one > job and you use a lot of them if necessary. I'd say you should use how > ever many tools enable you to complete the task efficiently, and it sounds > like your current setup isn't doing the job. Windows, my Linux machines don't have the hardware to do this anywhere near as fast. The reason I want the toolchain short is that one day, I'll run this on another machine, and it'll make it much easier to get it running again. -- Sent from: http://forum.openscad.org/