summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2023-02-13 21:50:23 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2023-02-13 21:50:23 +0000
commit1517bd915f76d411108919a5bc705b15e7cc5f8b (patch)
tree3ecb44dbd0bbbcb0daade96d9747d6006820dbd9 /Master/texmf-dist
parent01fbb21187a4477badb461174d2718d8ac04303a (diff)
Epspdf: remove unnecessary erroneous unsafe writability test
git-svn-id: svn://tug.org/texlive/trunk@65825 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/info/epspdf.info250
-rw-r--r--Master/texmf-dist/doc/support/epspdf/README8
-rw-r--r--Master/texmf-dist/doc/support/epspdf/epspdf.pdfbin220448 -> 220983 bytes
-rw-r--r--Master/texmf-dist/doc/support/epspdf/epspdf.texi35
-rw-r--r--Master/texmf-dist/scripts/epspdf/epspdf.help166
-rwxr-xr-xMaster/texmf-dist/scripts/epspdf/epspdf.tlu107
6 files changed, 293 insertions, 273 deletions
diff --git a/Master/texmf-dist/doc/info/epspdf.info b/Master/texmf-dist/doc/info/epspdf.info
index 0a6bd784f20..94746181291 100644
--- a/Master/texmf-dist/doc/info/epspdf.info
+++ b/Master/texmf-dist/doc/info/epspdf.info
@@ -1,8 +1,9 @@
-This is epspdf.info, produced by makeinfo version 6.7 from epspdf.texi.
+This is epspdf.info, produced by makeinfo version 7.0.2 from
+epspdf.texi.
-This manual is for epspdf and epspdftk, version 0.6.5.
+This manual is for epspdf and epspdftk, version 0.6.5.1.
-Copyright (C) 2006-2020 Siep Kroonenberg.
+Copyright © 2006-2023 Siep Kroonenberg.
Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty provided
@@ -19,9 +20,9 @@ File: epspdf.info, Node: Top, Next: Usage, Prev: (dir), Up: (dir)
Epspdf and epspdftk
*******************
-This manual is for epspdf and epspdftk, version 0.6.5.
+This manual is for epspdf and epspdftk, version 0.6.5.1.
-Copyright (C) 2006-2020 Siep Kroonenberg.
+Copyright © 2006-2023 Siep Kroonenberg.
Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty provided
@@ -38,7 +39,7 @@ Copyright (C) 2006-2020 Siep Kroonenberg.
* Requirements::
* Change history::
- -- The Detailed Node Listing --
+ — The Detailed Node Listing —
Usage
@@ -81,6 +82,7 @@ Troubleshooting
Change history
+* Version 0.6.5.1::
* Version 0.6.5::
* Version 0.6.4::
* Version 0.6::
@@ -138,19 +140,19 @@ File: epspdf.info, Node: Conversion options, Next: Converting, Prev: Viewing,
1.3 Conversion options
======================
- * Grayscaling
+ • Grayscaling
- * Compute tight boundingbox. This option is only available if a
+ • Compute tight boundingbox. This option is only available if a
single page is converted.
- * Page selection. The only possibilities are selecting a single page
+ • Page selection. The only possibilities are selecting a single page
or selecting all pages. Converting to eps implies selecting a
single page.
Note. For general PostScript files, there is no quick way to determine
the number of pages, so the program may not check beforehand whether you
-picked an existing page. If you don't like that, convert the entire
-document to pdf first - which will be done behind the scenes anyway.
+picked an existing page. If you don’t like that, convert the entire
+document to pdf first – which will be done behind the scenes anyway.
Specifying options such as grayscaling or page selection may require a
multistep conversion.
@@ -163,7 +165,7 @@ File: epspdf.info, Node: Converting, Next: The configuration screen, Prev: Co
The Convert and save... button calls up a file save dialog. After a
successful conversion, the result becomes the new current file, so you
-can judge the result by pressing the View button again - if epspdftk
+can judge the result by pressing the View button again – if epspdftk
thinks that there is a suitable viewer.

@@ -188,21 +190,21 @@ check whether such a plugin is actually installed.
For Windows and Mac OS there is no such configuration option. Epspdf
will use the program associated with the file type, which can be
-configured outside epspdf.
+configured outside of epspdf.
1.5.2 Options for converting to pdf
-----------------------------------
-Double-check the setting "Target use" under "Conversion to pdf".
-"prepress" is for pdfs which are going to be printed commercially. The
+Double-check the setting “Target use” under “Conversion to pdf”.
+“prepress” is for pdfs which are going to be printed commercially. The
options prepress, printer and default will try to embed all fonts.
Often, printshops insist on this.
-On the other hand, you may prefer "screen" if file size is a concern.
+On the other hand, you may prefer “screen” if file size is a concern.
See also the Ghostscript documentation, in particular Use.htm and
VectorDevices.htm.
-Specifying anything other than "default" may cause an additional
+Specifying anything other than “default” may cause an additional
conversion step and possibly also loss of high-level structure.
As to pdf versions: this is a trade-off between more features for higher
@@ -210,7 +212,7 @@ versions and better compatibility for lower versions. Versions below
1.4 do not support transparency. Converting a page or graphic with
transparencies to version 1.3 will probably result in the whole page or
graphic getting rasterized. For prepress use, consult your printshop or
-publisher. Otherwise leave the pdf version at "default".
+publisher. Otherwise leave the pdf version at “default”.
1.5.3 Options for converting to PostScript
------------------------------------------
@@ -252,10 +254,10 @@ File: epspdf.info, Node: Option summary, Prev: Command-line usage, Up: Comman
2.1 Option summary
==================
-Typing 'epspdf --help' gives you the following summary:
+Typing ‘epspdf --help’ gives you the following summary:
$ epspdf --help
- Epspdf version 0.6.4
- Copyright (c) 2006-2019 Siep Kroonenberg
+ Epspdf version 0.6.5.1
+ Copyright (c) 2006-2023 Siep Kroonenberg
Convert between [e]ps and pdf formats
Usage: epspdf[.tlu] [options] infile [outfile]
@@ -322,7 +324,7 @@ So avoid converting vector to bitmap. However, converting from bitmap
to vector is also best avoided, since it is very hard to do well.
Epspdf usually avoids conversion from vector to bitmap and never
-converts the other way. With the screen- and ebook "Target use" option,
+converts the other way. With the screen- and ebook “Target use” option,
included bitmaps tend to be downsampled, i.e. reduced to a lower
resolution.
@@ -333,9 +335,9 @@ File: epspdf.info, Node: Font embedding, Next: Eps preview headers, Prev: Bit
==================
When converting to pdf, Ghostscript handles font embedding differently
-depending on the "Target use" option. According to the Ghostscript
+depending on the “Target use” option. According to the Ghostscript
documentation, it embeds all fonts without exception for all targets
-except "screen", for which standard fonts such as Times may be omitted.
+except “screen”, for which standard fonts such as Times may be omitted.

File: epspdf.info, Node: Eps preview headers, Next: Bounding- and other boxes, Prev: Font embedding, Up: Notes on PostScript and pdf
@@ -356,8 +358,8 @@ File: epspdf.info, Node: Bounding- and other boxes, Next: Orientation, Prev:
A PostScript file may have a page size and a boundingbox defined. A pdf
file may have a mediabox, a trimbox and various other boxes.
-Ghostscript by itself normally converts the PostScript page - which is
-anchored at (0,0) - to the pdf mediabox.
+Ghostscript by itself normally converts the PostScript page – which is
+anchored at (0,0) – to the pdf mediabox.
Conversion to pdf usually translates the bottom-left corner to the (0,0)
origin and sets the ...box to the size of the graphic. Anything outside
@@ -384,13 +386,13 @@ Microsoft Office 2010 can now export to pdf, either the entire document
or a selection. This removes a major headache for Windows users.
Windows 10 also includes a pdf printer.
-As a last resort on earlier Windows versions, you can "print" to a
+As a last resort on earlier Windows versions, you can “print” to a
PostScript file. From some programs, you can print a selection. A
suitable driver which comes with Windows is Generic / MS Publisher Color
-Printer. Pay attention to the printer properties: choose "Outline" for
-font downloading and avoid the "Optimize for speed" setting for
-PostScript Output Option. In my tests, "Encapsulated PostScript" did
-not look very promising either. Try e.g. "Archive" instead. These
+Printer. Pay attention to the printer properties: choose “Outline” for
+font downloading and avoid the “Optimize for speed” setting for
+PostScript Output Option. In my tests, “Encapsulated PostScript” did
+not look very promising either. Try e.g. “Archive” instead. These
options can be found under the Advanced button.

@@ -419,10 +421,10 @@ _sam2p_
This command-line bitmap-to-PostScript/pdf conversion utility is
available from <http://code.google.com/p/sam2p/> and may already be
packaged for your distribution. It produces very small files:
- 'sam2p image.png image.eps'
+ ‘sam2p image.png image.eps’
_ImageMagick/convert_
- 'convert' from the ImageMagick package is a command-line utility:
- 'convert image.png image.eps'
+ ‘convert’ from the ImageMagick package is a command-line utility:
+ ‘convert image.png image.eps’
_The GIMP_
This is the premier open source image editing program. It is often
pre-installed on Linux, and is also available for other platforms.
@@ -434,7 +436,7 @@ File: epspdf.info, Node: Mac OS, Next: Windows, Prev: Linux, Up: Bitmapped g
4.2 Mac OS
==========
-Mac OS's built-in Preview application can read most bitmapped formats
+Mac OS’s built-in Preview application can read most bitmapped formats
and save them as pdf or PostScript. In fact, in many cases it is an
excellent alternative to epspdf.
@@ -445,17 +447,17 @@ File: epspdf.info, Node: Windows, Prev: Mac OS, Up: Bitmapped graphics for La
===========
I know of no built-in facility for converting bitmaps to eps or pdf,
-apart from "printing" to PostScript or pdf. However, many image editors
+apart from “printing” to PostScript or pdf. However, many image editors
can convert to eps or pdf. A couple of command-line utilities:
sam2p image.png image.eps
or
bmeps -c image.png image.eps
sam2p is distributed with TeX Live (Windows only), bmeps both with TeX
-Live and with MikTeX. Without the '-c' option, bmeps produces a
+Live and with MikTeX. Without the ‘-c’ option, bmeps produces a
grayscale image. It produces larger files than sam2p.
With TeX Live, you can convert to eps by right-clicking an image in
-Windows Explorer and "open" with _bitmap2eps_, which uses sam2p or bmeps
+Windows Explorer and “open” with _bitmap2eps_, which uses sam2p or bmeps
in the background.

@@ -491,9 +493,9 @@ File: epspdf.info, Node: Ghostscript stackunderflow error, Next: Error message
====================================
Some Ghostscript versions, _e.g._ 9.10, have an error in color handling
-when converting to pdf: selecting "printer" as target may lead to an
-error 'stackunderflow in .setdistillerparams'. If you run into this,
-use the "default" or "prepress" target instead.
+when converting to pdf: selecting “printer” as target may lead to an
+error ‘stackunderflow in .setdistillerparams’. If you run into this,
+use the “default” or “prepress” target instead.

File: epspdf.info, Node: Error message ``pdf_crop failed'', Next: Wrong boundingbox (.eps or .ps output), Prev: Ghostscript stackunderflow error, Up: Troubleshooting
@@ -511,7 +513,7 @@ File: epspdf.info, Node: Wrong boundingbox (.eps or .ps output), Next: Part of
==========================================
This may be a bug in pdftops. Do not use pdftops (epspdftk: see
-configuration screen; command-line epspdf: use the "-I" option)
+configuration screen; command-line epspdf: use the “-I” option)

File: epspdf.info, Node: Part of the graphic gets cut off, Next: Fonts look ugly, Prev: Wrong boundingbox (.eps or .ps output), Up: Troubleshooting
@@ -520,7 +522,7 @@ File: epspdf.info, Node: Part of the graphic gets cut off, Next: Fonts look ug
====================================
If the PostScript file was generated with the old Windows PostScript
-driver, experiment with the PostScript Output option. Don't choose
+driver, experiment with the PostScript Output option. Don’t choose
Optimize for Speed.

@@ -544,8 +546,8 @@ File: epspdf.info, Node: The page has been converted to a bitmap, Next: Tempor
The usual cause is that the page contains features such as transparency
which are not supported by the target format.
-Otherwise, set pdf target use and target version both to "default" to
-avoid unnecessary conversions: '-T default -N default'
+Otherwise, set pdf target use and target version both to “default” to
+avoid unnecessary conversions: ‘-T default -N default’

File: epspdf.info, Node: Temporary files are not removed, Next: Resources for troubleshooting, Prev: The page has been converted to a bitmap, Up: Troubleshooting
@@ -553,9 +555,9 @@ File: epspdf.info, Node: Temporary files are not removed, Next: Resources for
5.8 Temporary files are not removed
===================================
- * Command-line: make sure that you did not specify the option '-d'.
- * Epspdftk GUI: make sure that 'Remove temp files' is checked.
- * Windows: this platform is notorious for excessive file locking. I
+ • Command-line: make sure that you did not specify the option ‘-d’.
+ • Epspdftk GUI: make sure that ‘Remove temp files’ is checked.
+ • Windows: this platform is notorious for excessive file locking. I
already inserted a Windows-specific delay before attempting to
delete the temporary files, but this is not always enough.
However, you should have no trouble removing temporary files
@@ -568,10 +570,10 @@ File: epspdf.info, Node: Resources for troubleshooting, Prev: Temporary files
=================================
Logfile. The GUI has a button for viewing log output. This same output
-is also written to a file 'epspdf.log'. For Linux/Unix/Mac Mac OS this
+is also written to a file ‘epspdf.log’. For Linux/Unix/Mac Mac OS this
is in a subdirectory .epspdf of your home directory; for Windows it is
-in a subdirectory epspdf of '%APPDATA%'. This APPDATA directory may be
-'c:\Users\YOUR USER NAME\AppData\Roaming'. Type
+in a subdirectory epspdf of ‘%APPDATA%’. This APPDATA directory may be
+‘c:\Users\YOUR USER NAME\AppData\Roaming’. Type
echo %APPDATA%
in a Command Prompt window to find out which.
@@ -579,13 +581,13 @@ The logfile lists all epspdf calls and all Ghostscript- and pdftops
calls plus error information.
Temporary files. The temporary files may give clues as well. Uncheck
-the button "Remove temp files", or for the command-line version, give a
+the button “Remove temp files”, or for the command-line version, give a
-d parameter to keep the temporary files. Check the log(file) as to
which temporary files have been created.
Ghostscript- and pdftops documentation. For Ghostscript, the most
important files are VectorDevices.htm and Use.htm. For pdftops, type
-'pdftops -h'. For Unix, there is also a man page, and for Windows there
+‘pdftops -h’. For Unix, there is also a man page, and for Windows there
is a file pdftops.txt in the distribution zip. TeX Live includes the
man page in pdf format: pdftops.pdf.
@@ -603,13 +605,14 @@ luatex. It may further benefit from the presence of pdftops. MiKTeX
and TeX Live for Windows meet these requirements out of the box.
The front end requires a Tcl/Tk installation, or at least a tclkit
-runtime. TeX Live for Windows contains such a tclkit since late 2018,
-and epspdftk as a TeX Live package will make use of it. The minimum
-version is 8.5.
+runtime. TeX Live for Windows contains either a tclkit runtime or a
+minimal Tcl/Tk installation since late 2018, and epspdftk as a TeX Live
+package will make use of it. The minimum version is 8.5.
-For Windows there is an alternate epspdf-setup package on CTAN with an
-embedded Tcl/Tk runtime and a regular Windows installer, which also
-creates a menu shortcut and an uninstaller.
+At the time of writing, this front end does not work under MiKTeX; I do
+not know why not. The alternative epspdf-setup package for Windows with
+an embedded Tcl/Tk runtime and an installer has been withdrawn, since it
+was only useful on MiKTeX.

File: epspdf.info, Node: Change history, Prev: Requirements, Up: Top
@@ -619,6 +622,7 @@ Appendix B Change history
* Menu:
+* Version 0.6.5.1::
* Version 0.6.5::
* Version 0.6.4::
* Version 0.6::
@@ -626,9 +630,20 @@ Appendix B Change history
* Version 0.4::

-File: epspdf.info, Node: Version 0.6.5, Next: Version 0.6.4, Prev: Change history, Up: Change history
+File: epspdf.info, Node: Version 0.6.5.1, Next: Version 0.6.5, Prev: Change history, Up: Change history
-B.1 Version 0.6.5
+B.1 Version 0.6.5.1
+===================
+
+Epspdf: An erroneous and unnecessary check for writability, with
+possible security implications, has been removed. For MiKTeX,
+os.execute replaces os.spawn invocations, since os.spawn gave trouble in
+my tests on MiKTeX.
+
+
+File: epspdf.info, Node: Version 0.6.5, Next: Version 0.6.4, Prev: Version 0.6.5.1, Up: Change history
+
+B.2 Version 0.6.5
=================
Epspdf: Compatibility change for ghostscript 9.50 and later.
@@ -641,7 +656,7 @@ A few updates to the manual, mostly for the troubleshooting section.

File: epspdf.info, Node: Version 0.6.4, Next: Version 0.6, Prev: Version 0.6.5, Up: Change history
-B.2 Version 0.6.4
+B.3 Version 0.6.4
=================
Compatibility changes for luatex 1.9 and later.
@@ -658,17 +673,17 @@ console windows popping up.

File: epspdf.info, Node: Version 0.6, Next: Version 0.5, Prev: Version 0.6.4, Up: Change history
-B.3 Version 0.6
+B.4 Version 0.6
===============
The command-line backend component has been rewritten in texlua and
therefore no longer needs an external scripting language.
-Grayscaling is now done by Ghostscript's color options for pdf output.
+Grayscaling is now done by Ghostscript’s color options for pdf output.
This also works for bitmaps.
Croppping of pdfs is now accomplished by running luatex on a suitable
-wrapper file (same method as Heiko Oberdiek's pdfcrop). Such a
+wrapper file (same method as Heiko Oberdiek’s pdfcrop). Such a
conversion preserves advanced features which might otherwise get lost.
I no longer try to provide an AppleScript wrapper.
@@ -680,7 +695,7 @@ have no effect.

File: epspdf.info, Node: Version 0.5, Next: Version 0.4, Prev: Version 0.6, Up: Change history
-B.4 Version 0.5
+B.5 Version 0.5
===============
The GUI has been rewritten in Tcl/Tk, removing the dependence on the
@@ -688,92 +703,93 @@ Ruby/Tk interface library.
The Windows installer now installs a small Ruby subset and the standard
epspdf distribution, but with epspdftk.tcl replaced with a starpack: a
-single executable containing 'epspdftk.tcl' and a Tcl/Tk runtime. See
+single executable containing ‘epspdftk.tcl’ and a Tcl/Tk runtime. See
<http://wiki.tcl.tk/52>.
Epspdf now uses its own subdirectory for both the logfile and the
-configuration file. For Linux/Unix/Mac OS this is '$HOME/.epspdf', for
-Windows it is '%APPDATA%\epspdf'. On all supported platforms, settings
-are stored in the file 'config' in this directory. Under Windows, the
+configuration file. For Linux/Unix/Mac OS this is ‘$HOME/.epspdf’, for
+Windows it is ‘%APPDATA%\epspdf’. On all supported platforms, settings
+are stored in the file ‘config’ in this directory. Under Windows, the
registry is no longer used for this.
A button has been added to view log output.
-There is a second new button "Remove temp files", which is normally
+There is a second new button “Remove temp files”, which is normally
checked, causing temporary files to be deleted after each conversion.
Unchecking this button may be useful for troubleshooting. In previous
versions, temporary files were deleted at the end of the entire epspdftk
session but that has become less practical now that the GUI and epspdf
itself have become two separate programs.
-The "Open with..." option for Windows has been dropped for technical
+The “Open with...” option for Windows has been dropped for technical
reasons.
-The "-version" option now prints the version string instead of setting
+The “–version” option now prints the version string instead of setting
the desired pdf version.
-The "-info" option now also prints the number of pages for pdf files.
+The “–info” option now also prints the number of pages for pdf files.

File: epspdf.info, Node: Version 0.4, Prev: Version 0.5, Up: Change history
-B.5 Version 0.4
+B.6 Version 0.4
===============
Hi-res boundingboxes are now supported. By default, conversion from eps
-to pdf now uses the hires boundingbox as "page" to determine the page
+to pdf now uses the hires boundingbox as “page” to determine the page
dimensions of the pdf file. Other conversions preserve or generate a
hires boundingbox.
Under Windows, the new version looks for an installed TeX and will use
its private Ghostscript if it cannot find a separately installed
-Ghostscript. TeX Live's pdftops, being on the searchpath, will be used
+Ghostscript. TeX Live’s pdftops, being on the searchpath, will be used
unless epspdf finds another copy first.
-There is now a "-v" (lowercase) option to print the version string.
+There is now a “-v” (lowercase) option to print the version string.

Tag Table:
-Node: Top552
-Node: Usage2087
-Node: Overview2290
-Node: Viewing2675
-Node: Conversion options3136
-Ref: gray3283
-Node: Converting3934
-Node: The configuration screen4327
-Node: Command-line usage6538
-Node: Option summary7254
-Node: Notes on PostScript and pdf8561
-Node: Bitmapped and vector8944
-Node: Font embedding10174
-Node: Eps preview headers10629
-Node: Bounding- and other boxes11076
-Node: Orientation11698
-Node: Exporting PostScript or pdf from Windows programs12131
-Node: Bitmapped graphics for LaTeX and pdflatex13084
-Node: Linux13553
-Node: Mac OS14306
-Node: Windows14616
-Node: Troubleshooting15367
-Node: No options for output format visible15870
-Node: Ghostscript stackunderflow error16174
-Node: Error message ``pdf_crop failed''16681
-Node: Wrong boundingbox (.eps or .ps output)17067
-Node: Part of the graphic gets cut off17457
-Node: Fonts look ugly17845
-Node: The page has been converted to a bitmap18377
-Node: Temporary files are not removed18866
-Node: Resources for troubleshooting19531
-Ref: Documentation20478
-Node: Requirements20796
-Node: Change history21693
-Node: Version 0.6.521915
-Node: Version 0.6.422272
-Node: Version 0.622778
-Node: Version 0.523560
-Node: Version 0.425039
+Node: Top555
+Node: Usage2113
+Node: Overview2316
+Node: Viewing2701
+Node: Conversion options3162
+Ref: gray3311
+Node: Converting3970
+Node: The configuration screen4365
+Node: Command-line usage6603
+Node: Option summary7319
+Node: Notes on PostScript and pdf8632
+Node: Bitmapped and vector9015
+Node: Font embedding10249
+Node: Eps preview headers10712
+Node: Bounding- and other boxes11159
+Node: Orientation11785
+Node: Exporting PostScript or pdf from Windows programs12218
+Node: Bitmapped graphics for LaTeX and pdflatex13191
+Node: Linux13660
+Node: Mac OS14425
+Node: Windows14737
+Node: Troubleshooting15500
+Node: No options for output format visible16003
+Node: Ghostscript stackunderflow error16307
+Node: Error message ``pdf_crop failed''16830
+Node: Wrong boundingbox (.eps or .ps output)17216
+Node: Part of the graphic gets cut off17610
+Node: Fonts look ugly18000
+Node: The page has been converted to a bitmap18532
+Node: Temporary files are not removed19029
+Node: Resources for troubleshooting19708
+Ref: Documentation20671
+Node: Requirements20993
+Node: Change history21995
+Node: Version 0.6.5.122237
+Node: Version 0.6.522611
+Node: Version 0.6.422969
+Node: Version 0.623475
+Node: Version 0.524261
+Node: Version 0.425776

End Tag Table
diff --git a/Master/texmf-dist/doc/support/epspdf/README b/Master/texmf-dist/doc/support/epspdf/README
index 9869ec09410..6b66f8b34a6 100644
--- a/Master/texmf-dist/doc/support/epspdf/README
+++ b/Master/texmf-dist/doc/support/epspdf/README
@@ -4,7 +4,7 @@ command-line backend, can be used by itself.
Both are scripts: epspdf.tlu is written in texlua and uses the
texlua script interpreter from TeX Live or MiKTeX. Epspdftk.tcl
requires Tcl/Tk, either a full installation or a tclkit runtime. TeX
-Live already includes a tclkit runtime for Windows.
+Live already includes a minimal Tcl/Tk for Windows.
Epspdftk.tcl can find the other files as long are they are all in
the same directory. epspdf4tk.cmd is needed only when running
@@ -12,6 +12,6 @@ epspdftk.tcl under Windows.
Full documentation is available in the doc subdirectory.
-Windows MiKTeX users: you may prefer the epspdf-setup package, which
-installs a version of epspdftk which includes a regular installer
-and requires no software beyond MiKTeX.
+Windows MiKTeX users: the epspdftk GUI currently does not work with
+a MiKTeX installation. Therefore, the former epspdf-setup package is
+not being offered any more.
diff --git a/Master/texmf-dist/doc/support/epspdf/epspdf.pdf b/Master/texmf-dist/doc/support/epspdf/epspdf.pdf
index 637a4fd89f8..270f337b5d1 100644
--- a/Master/texmf-dist/doc/support/epspdf/epspdf.pdf
+++ b/Master/texmf-dist/doc/support/epspdf/epspdf.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/epspdf/epspdf.texi b/Master/texmf-dist/doc/support/epspdf/epspdf.texi
index 6d5c254ac41..52693d4484b 100644
--- a/Master/texmf-dist/doc/support/epspdf/epspdf.texi
+++ b/Master/texmf-dist/doc/support/epspdf/epspdf.texi
@@ -29,7 +29,7 @@
@hyphenation{epspdf-tk epspdf}
@end iftex
-@set version 0.6.5
+@set version 0.6.5.1
@setchapternewpage off
@paragraphindent none
@@ -37,7 +37,7 @@
@copying
This manual is for epspdf and epspdftk, version @value{version}.
-Copyright @copyright{} 2006-2020 Siep Kroonenberg.
+Copyright @copyright{} 2006-2023 Siep Kroonenberg.
@quotation
Copying and distribution of this file, with or without modification,
@@ -124,6 +124,7 @@ Troubleshooting
Change history
+* Version 0.6.5.1::
* Version 0.6.5::
* Version 0.6.4::
* Version 0.6::
@@ -233,7 +234,7 @@ does not check whether such a plugin is actually installed.
For Windows and Mac OS there is no such configuration option. Epspdf
will use the program associated with the file type, which can be
-configured outside epspdf.
+configured outside of epspdf.
@subsection Options for converting to pdf
Double-check the setting ``Target use'' under ``Conversion to
@@ -292,8 +293,8 @@ epspdf [@var{options}] @var{infile} [@var{outfile}]
Typing @kbd{epspdf --help} gives you the following summary:
@example
$ epspdf --help
-Epspdf version 0.6.4
-Copyright (c) 2006-2019 Siep Kroonenberg
+Epspdf version 0.6.5.1
+Copyright (c) 2006-2023 Siep Kroonenberg
Convert between [e]ps and pdf formats
Usage: epspdf[.tlu] [options] infile [outfile]
@@ -591,18 +592,20 @@ luatex. It may further benefit from the presence of pdftops. MiKTeX and
TeX Live for Windows meet these requirements out of the box.
The front end requires a Tcl/Tk installation, or at least a tclkit
-runtime. TeX Live for Windows contains such a tclkit since late 2018,
-and epspdftk as a TeX Live package will make use of it. The minimum
-version is 8.5.
+runtime. TeX Live for Windows contains either a tclkit runtime or a
+minimal Tcl/Tk installation since late 2018, and epspdftk as a TeX Live
+package will make use of it. The minimum version is 8.5.
-For Windows there is an alternate epspdf-setup package on CTAN with an
-embedded Tcl/Tk runtime and a regular Windows installer, which also
-creates a menu shortcut and an uninstaller.
+At the time of writing, this front end does not work under MiKTeX; I do
+not know why not. The alternative epspdf-setup package for Windows with
+an embedded Tcl/Tk runtime and an installer has been withdrawn, since it
+was only useful on MiKTeX.
@node Change history, , Requirements, Top
@appendix Change history
@menu
+* Version 0.6.5.1::
* Version 0.6.5::
* Version 0.6.4::
* Version 0.6::
@@ -610,7 +613,15 @@ creates a menu shortcut and an uninstaller.
* Version 0.4::
@end menu
-@node Version 0.6.5, Version 0.6.4, Change history, Change history
+@node Version 0.6.5.1, Version 0.6.5, Change history, Change history
+@section Version 0.6.5.1
+
+Epspdf: An erroneous and unnecessary check for writability, with
+possible security implications, has been removed. For MiKTeX, os.execute
+replaces os.spawn invocations, since os.spawn gave trouble in my tests
+on MiKTeX.
+
+@node Version 0.6.5, Version 0.6.4, Version 0.6.5.1, Change history
@section Version 0.6.5
Epspdf: Compatibility change for ghostscript 9.50 and later.
diff --git a/Master/texmf-dist/scripts/epspdf/epspdf.help b/Master/texmf-dist/scripts/epspdf/epspdf.help
index 8ee499c019b..d4745a5b296 100644
--- a/Master/texmf-dist/scripts/epspdf/epspdf.help
+++ b/Master/texmf-dist/scripts/epspdf/epspdf.help
@@ -33,17 +33,18 @@ Epspdf and epspdftk
5.9 Resources for troubleshooting
Appendix A Requirements
Appendix B Change history
- B.1 Version 0.6.5
- B.2 Version 0.6.4
- B.3 Version 0.6
- B.4 Version 0.5
- B.5 Version 0.4
+ B.1 Version 0.6.5.1
+ B.2 Version 0.6.5
+ B.3 Version 0.6.4
+ B.4 Version 0.6
+ B.5 Version 0.5
+ B.6 Version 0.4
Epspdf and epspdftk
*******************
-This manual is for epspdf and epspdftk, version 0.6.5.
+This manual is for epspdf and epspdftk, version 0.6.5.1.
-Copyright (C) 2006-2020 Siep Kroonenberg.
+Copyright © 2006-2023 Siep Kroonenberg.
Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty provided
@@ -80,19 +81,19 @@ for the current file.
1.3 Conversion options
======================
- * Grayscaling
+ • Grayscaling
- * Compute tight boundingbox. This option is only available if a
+ • Compute tight boundingbox. This option is only available if a
single page is converted.
- * Page selection. The only possibilities are selecting a single page
+ • Page selection. The only possibilities are selecting a single page
or selecting all pages. Converting to eps implies selecting a
single page.
Note. For general PostScript files, there is no quick way to determine
the number of pages, so the program may not check beforehand whether you
-picked an existing page. If you don't like that, convert the entire
-document to pdf first - which will be done behind the scenes anyway.
+picked an existing page. If you don’t like that, convert the entire
+document to pdf first – which will be done behind the scenes anyway.
Specifying options such as grayscaling or page selection may require a
multistep conversion.
@@ -102,7 +103,7 @@ multistep conversion.
The Convert and save... button calls up a file save dialog. After a
successful conversion, the result becomes the new current file, so you
-can judge the result by pressing the View button again - if epspdftk
+can judge the result by pressing the View button again – if epspdftk
thinks that there is a suitable viewer.
1.5 The configuration screen
@@ -124,21 +125,21 @@ check whether such a plugin is actually installed.
For Windows and Mac OS there is no such configuration option. Epspdf
will use the program associated with the file type, which can be
-configured outside epspdf.
+configured outside of epspdf.
1.5.2 Options for converting to pdf
-----------------------------------
-Double-check the setting "Target use" under "Conversion to pdf".
-"prepress" is for pdfs which are going to be printed commercially. The
+Double-check the setting “Target use” under “Conversion to pdf”.
+“prepress” is for pdfs which are going to be printed commercially. The
options prepress, printer and default will try to embed all fonts.
Often, printshops insist on this.
-On the other hand, you may prefer "screen" if file size is a concern.
+On the other hand, you may prefer “screen” if file size is a concern.
See also the Ghostscript documentation, in particular Use.htm and
VectorDevices.htm.
-Specifying anything other than "default" may cause an additional
+Specifying anything other than “default” may cause an additional
conversion step and possibly also loss of high-level structure.
As to pdf versions: this is a trade-off between more features for higher
@@ -146,7 +147,7 @@ versions and better compatibility for lower versions. Versions below
1.4 do not support transparency. Converting a page or graphic with
transparencies to version 1.3 will probably result in the whole page or
graphic getting rasterized. For prepress use, consult your printshop or
-publisher. Otherwise leave the pdf version at "default".
+publisher. Otherwise leave the pdf version at “default”.
1.5.3 Options for converting to PostScript
------------------------------------------
@@ -178,10 +179,10 @@ Basic usage of epspdf itself:
2.1 Option summary
==================
-Typing 'epspdf --help' gives you the following summary:
+Typing ‘epspdf --help’ gives you the following summary:
$ epspdf --help
- Epspdf version 0.6.4
- Copyright (c) 2006-2019 Siep Kroonenberg
+ Epspdf version 0.6.5.1
+ Copyright (c) 2006-2023 Siep Kroonenberg
Convert between [e]ps and pdf formats
Usage: epspdf[.tlu] [options] infile [outfile]
@@ -233,7 +234,7 @@ So avoid converting vector to bitmap. However, converting from bitmap
to vector is also best avoided, since it is very hard to do well.
Epspdf usually avoids conversion from vector to bitmap and never
-converts the other way. With the screen- and ebook "Target use" option,
+converts the other way. With the screen- and ebook “Target use” option,
included bitmaps tend to be downsampled, i.e. reduced to a lower
resolution.
@@ -241,9 +242,9 @@ resolution.
==================
When converting to pdf, Ghostscript handles font embedding differently
-depending on the "Target use" option. According to the Ghostscript
+depending on the “Target use” option. According to the Ghostscript
documentation, it embeds all fonts without exception for all targets
-except "screen", for which standard fonts such as Times may be omitted.
+except “screen”, for which standard fonts such as Times may be omitted.
3.3 Eps preview headers
=======================
@@ -258,8 +259,8 @@ Epspdf has no option to preserve or add them.
A PostScript file may have a page size and a boundingbox defined. A pdf
file may have a mediabox, a trimbox and various other boxes.
-Ghostscript by itself normally converts the PostScript page - which is
-anchored at (0,0) - to the pdf mediabox.
+Ghostscript by itself normally converts the PostScript page – which is
+anchored at (0,0) – to the pdf mediabox.
Conversion to pdf usually translates the bottom-left corner to the (0,0)
origin and sets the ...box to the size of the graphic. Anything outside
@@ -280,13 +281,13 @@ Microsoft Office 2010 can now export to pdf, either the entire document
or a selection. This removes a major headache for Windows users.
Windows 10 also includes a pdf printer.
-As a last resort on earlier Windows versions, you can "print" to a
+As a last resort on earlier Windows versions, you can “print” to a
PostScript file. From some programs, you can print a selection. A
suitable driver which comes with Windows is Generic / MS Publisher Color
-Printer. Pay attention to the printer properties: choose "Outline" for
-font downloading and avoid the "Optimize for speed" setting for
-PostScript Output Option. In my tests, "Encapsulated PostScript" did
-not look very promising either. Try e.g. "Archive" instead. These
+Printer. Pay attention to the printer properties: choose “Outline” for
+font downloading and avoid the “Optimize for speed” setting for
+PostScript Output Option. In my tests, “Encapsulated PostScript” did
+not look very promising either. Try e.g. “Archive” instead. These
options can be found under the Advanced button.
4 Bitmapped graphics for LaTeX and pdflatex
@@ -303,10 +304,10 @@ _sam2p_
This command-line bitmap-to-PostScript/pdf conversion utility is
available from <http://code.google.com/p/sam2p/> and may already be
packaged for your distribution. It produces very small files:
- 'sam2p image.png image.eps'
+ ‘sam2p image.png image.eps’
_ImageMagick/convert_
- 'convert' from the ImageMagick package is a command-line utility:
- 'convert image.png image.eps'
+ ‘convert’ from the ImageMagick package is a command-line utility:
+ ‘convert image.png image.eps’
_The GIMP_
This is the premier open source image editing program. It is often
pre-installed on Linux, and is also available for other platforms.
@@ -315,7 +316,7 @@ _The GIMP_
4.2 Mac OS
==========
-Mac OS's built-in Preview application can read most bitmapped formats
+Mac OS’s built-in Preview application can read most bitmapped formats
and save them as pdf or PostScript. In fact, in many cases it is an
excellent alternative to epspdf.
@@ -323,17 +324,17 @@ excellent alternative to epspdf.
===========
I know of no built-in facility for converting bitmaps to eps or pdf,
-apart from "printing" to PostScript or pdf. However, many image editors
+apart from “printing” to PostScript or pdf. However, many image editors
can convert to eps or pdf. A couple of command-line utilities:
sam2p image.png image.eps
or
bmeps -c image.png image.eps
sam2p is distributed with TeX Live (Windows only), bmeps both with TeX
-Live and with MikTeX. Without the '-c' option, bmeps produces a
+Live and with MikTeX. Without the ‘-c’ option, bmeps produces a
grayscale image. It produces larger files than sam2p.
With TeX Live, you can convert to eps by right-clicking an image in
-Windows Explorer and "open" with _bitmap2eps_, which uses sam2p or bmeps
+Windows Explorer and “open” with _bitmap2eps_, which uses sam2p or bmeps
in the background.
5 Troubleshooting
@@ -348,9 +349,9 @@ Widen the window, to make the output format radio buttons visible.
====================================
Some Ghostscript versions, _e.g._ 9.10, have an error in color handling
-when converting to pdf: selecting "printer" as target may lead to an
-error 'stackunderflow in .setdistillerparams'. If you run into this,
-use the "default" or "prepress" target instead.
+when converting to pdf: selecting “printer” as target may lead to an
+error ‘stackunderflow in .setdistillerparams’. If you run into this,
+use the “default” or “prepress” target instead.
5.3 Error message mentioning failure of pdf_crop
================================================
@@ -362,13 +363,13 @@ Live Manager or with the MiKTeX Console.
==========================================
This may be a bug in pdftops. Do not use pdftops (epspdftk: see
-configuration screen; command-line epspdf: use the "-I" option)
+configuration screen; command-line epspdf: use the “-I” option)
5.5 Part of the graphic gets cut off
====================================
If the PostScript file was generated with the old Windows PostScript
-driver, experiment with the PostScript Output option. Don't choose
+driver, experiment with the PostScript Output option. Don’t choose
Optimize for Speed.
5.6 Fonts look ugly
@@ -386,15 +387,15 @@ the xpdf suite and of the Poppler utilities.
The usual cause is that the page contains features such as transparency
which are not supported by the target format.
-Otherwise, set pdf target use and target version both to "default" to
-avoid unnecessary conversions: '-T default -N default'
+Otherwise, set pdf target use and target version both to “default” to
+avoid unnecessary conversions: ‘-T default -N default’
5.8 Temporary files are not removed
===================================
- * Command-line: make sure that you did not specify the option '-d'.
- * Epspdftk GUI: make sure that 'Remove temp files' is checked.
- * Windows: this platform is notorious for excessive file locking. I
+ • Command-line: make sure that you did not specify the option ‘-d’.
+ • Epspdftk GUI: make sure that ‘Remove temp files’ is checked.
+ • Windows: this platform is notorious for excessive file locking. I
already inserted a Windows-specific delay before attempting to
delete the temporary files, but this is not always enough.
However, you should have no trouble removing temporary files
@@ -404,10 +405,10 @@ avoid unnecessary conversions: '-T default -N default'
=================================
Logfile. The GUI has a button for viewing log output. This same output
-is also written to a file 'epspdf.log'. For Linux/Unix/Mac Mac OS this
+is also written to a file ‘epspdf.log’. For Linux/Unix/Mac Mac OS this
is in a subdirectory .epspdf of your home directory; for Windows it is
-in a subdirectory epspdf of '%APPDATA%'. This APPDATA directory may be
-'c:\Users\YOUR USER NAME\AppData\Roaming'. Type
+in a subdirectory epspdf of ‘%APPDATA%’. This APPDATA directory may be
+‘c:\Users\YOUR USER NAME\AppData\Roaming’. Type
echo %APPDATA%
in a Command Prompt window to find out which.
@@ -415,13 +416,13 @@ The logfile lists all epspdf calls and all Ghostscript- and pdftops
calls plus error information.
Temporary files. The temporary files may give clues as well. Uncheck
-the button "Remove temp files", or for the command-line version, give a
+the button “Remove temp files”, or for the command-line version, give a
-d parameter to keep the temporary files. Check the log(file) as to
which temporary files have been created.
Ghostscript- and pdftops documentation. For Ghostscript, the most
important files are VectorDevices.htm and Use.htm. For pdftops, type
-'pdftops -h'. For Unix, there is also a man page, and for Windows there
+‘pdftops -h’. For Unix, there is also a man page, and for Windows there
is a file pdftops.txt in the distribution zip. TeX Live includes the
man page in pdf format: pdftops.pdf.
@@ -436,18 +437,27 @@ luatex. It may further benefit from the presence of pdftops. MiKTeX
and TeX Live for Windows meet these requirements out of the box.
The front end requires a Tcl/Tk installation, or at least a tclkit
-runtime. TeX Live for Windows contains such a tclkit since late 2018,
-and epspdftk as a TeX Live package will make use of it. The minimum
-version is 8.5.
+runtime. TeX Live for Windows contains either a tclkit runtime or a
+minimal Tcl/Tk installation since late 2018, and epspdftk as a TeX Live
+package will make use of it. The minimum version is 8.5.
-For Windows there is an alternate epspdf-setup package on CTAN with an
-embedded Tcl/Tk runtime and a regular Windows installer, which also
-creates a menu shortcut and an uninstaller.
+At the time of writing, this front end does not work under MiKTeX; I do
+not know why not. The alternative epspdf-setup package for Windows with
+an embedded Tcl/Tk runtime and an installer has been withdrawn, since it
+was only useful on MiKTeX.
Appendix B Change history
*************************
-B.1 Version 0.6.5
+B.1 Version 0.6.5.1
+===================
+
+Epspdf: An erroneous and unnecessary check for writability, with
+possible security implications, has been removed. For MiKTeX,
+os.execute replaces os.spawn invocations, since os.spawn gave trouble in
+my tests on MiKTeX.
+
+B.2 Version 0.6.5
=================
Epspdf: Compatibility change for ghostscript 9.50 and later.
@@ -457,7 +467,7 @@ MacOS.
A few updates to the manual, mostly for the troubleshooting section.
-B.2 Version 0.6.4
+B.3 Version 0.6.4
=================
Compatibility changes for luatex 1.9 and later.
@@ -471,17 +481,17 @@ The GUI now requires Tcl/Tk version 8.5 or higher. On Windows,
epspdf.tlu is now invoked via a batchfile. This should prevent black
console windows popping up.
-B.3 Version 0.6
+B.4 Version 0.6
===============
The command-line backend component has been rewritten in texlua and
therefore no longer needs an external scripting language.
-Grayscaling is now done by Ghostscript's color options for pdf output.
+Grayscaling is now done by Ghostscript’s color options for pdf output.
This also works for bitmaps.
Croppping of pdfs is now accomplished by running luatex on a suitable
-wrapper file (same method as Heiko Oberdiek's pdfcrop). Such a
+wrapper file (same method as Heiko Oberdiek’s pdfcrop). Such a
conversion preserves advanced features which might otherwise get lost.
I no longer try to provide an AppleScript wrapper.
@@ -490,7 +500,7 @@ The current version has no provisions for custom Ghostscript- or pdftops
parameters. The corresponding command-line options are accepted but
have no effect.
-B.4 Version 0.5
+B.5 Version 0.5
===============
The GUI has been rewritten in Tcl/Tk, removing the dependence on the
@@ -498,44 +508,44 @@ Ruby/Tk interface library.
The Windows installer now installs a small Ruby subset and the standard
epspdf distribution, but with epspdftk.tcl replaced with a starpack: a
-single executable containing 'epspdftk.tcl' and a Tcl/Tk runtime. See
+single executable containing ‘epspdftk.tcl’ and a Tcl/Tk runtime. See
<http://wiki.tcl.tk/52>.
Epspdf now uses its own subdirectory for both the logfile and the
-configuration file. For Linux/Unix/Mac OS this is '$HOME/.epspdf', for
-Windows it is '%APPDATA%\epspdf'. On all supported platforms, settings
-are stored in the file 'config' in this directory. Under Windows, the
+configuration file. For Linux/Unix/Mac OS this is ‘$HOME/.epspdf’, for
+Windows it is ‘%APPDATA%\epspdf’. On all supported platforms, settings
+are stored in the file ‘config’ in this directory. Under Windows, the
registry is no longer used for this.
A button has been added to view log output.
-There is a second new button "Remove temp files", which is normally
+There is a second new button “Remove temp files”, which is normally
checked, causing temporary files to be deleted after each conversion.
Unchecking this button may be useful for troubleshooting. In previous
versions, temporary files were deleted at the end of the entire epspdftk
session but that has become less practical now that the GUI and epspdf
itself have become two separate programs.
-The "Open with..." option for Windows has been dropped for technical
+The “Open with...” option for Windows has been dropped for technical
reasons.
-The "-version" option now prints the version string instead of setting
+The “–version” option now prints the version string instead of setting
the desired pdf version.
-The "-info" option now also prints the number of pages for pdf files.
+The “–info” option now also prints the number of pages for pdf files.
-B.5 Version 0.4
+B.6 Version 0.4
===============
Hi-res boundingboxes are now supported. By default, conversion from eps
-to pdf now uses the hires boundingbox as "page" to determine the page
+to pdf now uses the hires boundingbox as “page” to determine the page
dimensions of the pdf file. Other conversions preserve or generate a
hires boundingbox.
Under Windows, the new version looks for an installed TeX and will use
its private Ghostscript if it cannot find a separately installed
-Ghostscript. TeX Live's pdftops, being on the searchpath, will be used
+Ghostscript. TeX Live’s pdftops, being on the searchpath, will be used
unless epspdf finds another copy first.
-There is now a "-v" (lowercase) option to print the version string.
+There is now a “-v” (lowercase) option to print the version string.
diff --git a/Master/texmf-dist/scripts/epspdf/epspdf.tlu b/Master/texmf-dist/scripts/epspdf/epspdf.tlu
index 1dba171bf18..93f0415014c 100755
--- a/Master/texmf-dist/scripts/epspdf/epspdf.tlu
+++ b/Master/texmf-dist/scripts/epspdf/epspdf.tlu
@@ -13,8 +13,11 @@ epspdf conversion utility
some refactoring; better handling of some corner cases
0.6.5: eliminate .setpdfwrite from ghostscript commandlines,
since this is now considered obsolete
+0.6.5.1: eliminate faulty check for writability system_tmpdir;
+ just error out when no tempdir for epspdf can be created.
+ Avoid spawn for MiKTeX.
-Copyright (C) 2006-2020 Siep Kroonenberg
+Copyright (C) 2006-2023 Siep Kroonenberg
siepo at bitmuis nl
@@ -304,40 +307,8 @@ function find_on_path (prog)
return false
end -- find_on_path
-function dir_writable(d)
- -- because directory attributes do not tell the whole story,
- -- we actually try to create a file in the directory.
- if not lfs.isdir(d) then
- return false
- end
- -- try to create a new file, write to it and delete it afterwards
- for i=1,1000 do
- local s = d .. '/' .. tostring(i)
- if not lfs.isfile(s) then
- local fh = io.open(s, "w")
- if fh then
- fh:write('test')
- fh:close()
- if lfs.isfile(s) then
- if lfs.attributes(s, 'size') > 0 then
- os.remove(s)
- return true
- else
- os.remove(s)
- return false -- open and write resulted in empty file
- end -- lfs.attributes
- else
- return false -- open and write did not result in a file
- end -- lfs.isfile
- end -- fh
- return false -- filename available; could not open for write
- end -- not lfs.isfile
- end -- for
- return false
-end
-
function system_tempdir ()
- local d
+ local d = false
if os.type=='windows' then
d = os.getenv('TEMP')
if not d then
@@ -350,9 +321,6 @@ function system_tempdir ()
end
end
-- cygwin: $TEMP=/tmp, root '/' being root of cygwin installation
- if d and not dir_writable(d) then
- d = false
- end
return d
end
@@ -403,6 +371,20 @@ function tab_combine (t)
return res
end -- tab_combine
+-- workaround for miktex spawn problem
+function spawnexec(cmd)
+ if is_miktex then
+ if type(cmd)=='table' then
+ return os.execute(table.concat(cmd, ' '))
+ -- there is no need for quoting in the cases used
+ else
+ return os.execute(cmd)
+ end
+ else
+ return os.spawn(cmd)
+ end
+end
+
-- files ----------------------------------------------------
-- Copy a file in chunks, with optional length and offset.
-- Since files may be very large, we copy them piecemeal.
@@ -1547,13 +1529,7 @@ function PsPdf:pdf_crop()
-- if os.type=='unix' then
cmd = {luatex_prog, '--safer', '--no-shell-escape', textemp}
log_cmd(cmd)
- res = os.spawn(cmd)
- -- else
- -- cmd = luatex_prog..' --safer --no-shell-escape '..textemp
- -- log_cmd({cmd})
- -- -- os.execute('timeout /t 1 /nobreak >nul')
- -- res = os.execute(cmd)
- -- end
+ res = spawnexec(cmd)
if res and res==0 and lfs.attributes(pdftemp, 'size')>0 then
psp = PsPdf:from_path(pdftemp)
options.bbox = false
@@ -1583,7 +1559,7 @@ function PsPdf:eps_to_pdf()
cmd = tab_combine({cmd, pdf_tail_options})
table.insert(cmd, self.path)
log_cmd(cmd)
- local res = os.spawn(cmd)
+ local res = spawnexec(cmd)
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
psp.pages, psp.miver, psp.maver = pdf_props(psp.path)
options.gray = false
@@ -1623,7 +1599,7 @@ function PsPdf:pdf_to_pdf()
cmd = tab_combine({cmd, pdf_tail_options})
table.insert(cmd, self.path)
log_cmd(cmd)
- local res = os.spawn(cmd)
+ local res = spawnexec(cmd)
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
psp.pages, psp.miver, psp.maver = pdf_props(psp.path)
options.gray = false
@@ -1655,10 +1631,9 @@ function PsPdf:pdf_to_eps()
-- which are usually harmless and for which I know no easy fix
-- pdftops -q does not do the trick on Windows,
-- and redirection to logfile gives access denied under miktex
- -- res = os.spawn({'cmd', '/c', table.concat(cmd, ' ')..' 2>>'..log_bsl})
res = os.execute(table.concat(cmd, ' ')..' 2>nul')
else
- res = os.spawn(cmd)
+ res = spawnexec(cmd)
end
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
psp.pages = 1
@@ -1732,7 +1707,7 @@ function PsPdf:pdf_to_eps()
table.insert(cmd, '-sOutputFile='..psp.path)
table.insert(cmd, self.path)
log_cmd(cmd)
- res = os.spawn(cmd)
+ res = spawnexec(cmd)
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
psp.pages = 1
options.page = false
@@ -1762,7 +1737,7 @@ function PsPdf:ps_to_pdf()
cmd = tab_combine({cmd, pdf_tail_options})
table.insert(cmd, self.path)
log_cmd(cmd)
- local res = os.spawn(cmd)
+ local res = spawnexec(cmd)
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
psp.pages, psp.miver, psp.maver = pdf_props(psp.path)
options.gray = false
@@ -1805,10 +1780,9 @@ function PsPdf:pdf_to_ps()
-- which are usually harmless and for which I know no easy fix
-- pdftops -q does not do the trick on Windows,
-- and redirection to logfile gives access denied under miktex
- -- res = os.spawn({'cmd', '/c', table.concat(cmd, ' ')..' 2>>'..log_bsl})
res = os.execute(table.concat(cmd, ' ')..' 2>nul')
else
- res = os.spawn(cmd)
+ res = spawnexec(cmd)
end
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
options.page = false
@@ -1833,7 +1807,7 @@ function PsPdf:ps_to_ps()
table.insert(cmd, '-sOutputFile#'..psp.path)
table.insert(cmd, self.path)
log_cmd(cmd)
- local res = os.spawn(cmd)
+ local res = spawnexec(cmd)
if res and res==0 and lfs.attributes(psp.path, 'size')>0 then
options.gray = false
return psp
@@ -1901,9 +1875,12 @@ function any_to_any()
if settings.pdf_target and (settings.pdf_target~='default') then
table.insert(pdf_options, '-dPDFSETTINGS#/'..settings.pdf_target)
end
- if settings.pdf_target~='screen' and settings.pdf_target~='ebook' then
- pdf_tail_options = {
- '-c', '<</NeverEmbed [ ] >> setdistillerparams', '-f'}
+ if not is_miktex then
+ -- options below cause trouble with unpacked cmd table
+ if settings.pdf_target~='screen' and settings.pdf_target~='ebook' then
+ pdf_tail_options = {
+ '-c', '<</NeverEmbed [ ] >> setdistillerparams', '-f'}
+ end
end
end
@@ -2063,7 +2040,7 @@ function any_to_any()
end
if (not need_gs) and options.page then
psp = psp:pdf_crop()
- -- less invasive that page selection by gs
+ -- less invasive than page selection by gs
end
if need_gs then
psp = psp:pdf_to_pdf() -- will handle page selection too
@@ -2395,7 +2372,7 @@ do -- main program
-- a couple of functions only available during command-line parsing
local function show_version ()
- print('Epspdf version 0.6.4\nCopyright (c) 2006-2019 Siep Kroonenberg')
+ print('Epspdf version 0.6.5.1\nCopyright (c) 2006-2023 Siep Kroonenberg')
end
local function help (mess) -- requires opts array
@@ -2649,10 +2626,16 @@ do -- main program
-- a directory under a dedicated temp directory, which has a better chance
-- of getting cleaned up by the system.
- lfs.chdir(system_tempdir() or out_dir)
- -- no check for failure; we create a subdirectory in
- -- whatever is the current directory
- tempdir = os.tmpdir()
+ for i, d in pairs({system_tempdir(), out_dir}) do
+ if not lfs.chdir(d) then
+ io.stdout:write('cannot cd into '..d..'\n')
+ goto continue
+ end
+ tempdir = os.tmpdir()
+ if not tempdir then goto continue end
+ break
+ ::continue::
+ end
if not tempdir then
errror('Cannot create directory for temporary files')
end