summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo in the warning in pdfa_def.psKen Sharp2023-04-281-1/+1
|
* Update postal address in file headersChris Liddell2023-04-0458-173/+173
|
* Bug #705699Ken Sharp2022-08-016-0/+13
| | | | | | | | | | | | | " “Error: /invalidfileaccess in --file--” when converting PBM file to PDF" There is no actual bug here, the user had not supplied either -dNOSAFER or --permit-file-read on the command line to allow the interpreter to read the input file. However the viewpbm.ps program doesn't have that information in its 'usage' which would be useful information. So added that here, and updated a number of other view*.ps programs which have usage information to include this as well.
* GhostPDF - revamp PDF information extractionKen Sharp2022-05-101-1/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A customer requested that we make pdf_info.ps work with the new PDF interpreter, and generate the same information. This commit modifies the way we extract information on a page-by-page basis to potentially include the names of spot inks and information about fonts used on the page. This is now returned to the PostScript environment using a PDF dictionary instead of a C structure. The pdf_info.ps program has been updated so that it use the new information in broadly the same way as the information from the old PDF interpreter. There are differences; pdf_info.ps extracts font information itself, rather than having the interpreter do it. This is not possible with the new interpreter which is why we have the PDF interpreter do it for us. In addition the pdf_info.ps program only descended to the page level whereas the new PDF interpreter evaluates all objects on the page, potentially meaning that more fonts (and technically spot inks) might be detected. We now have an additional PostScript operator '.PDFPageInfoExt' which returns 'extended' information about a page. This is the same as .PDFPageInfo but includes the font and spot ink information. Running with -dPDFINFO using either Ghostscript or GhostPDF will print more information than before, including the spot inks and considerably more information about fonts than the pdf_info.ps program emits, including embedding status, descendant fonts (and their membedding status) and the presence of ToUnicode CMaps. Updated documentation for all of the above.
* Bug 703862 correct FileSpec to FilespecKen Sharp2022-04-281-1/+1
| | | | | | File Specification dictionaries should have a Type of Filespec, not FileSpec as was previously used. There is no consistency in the PDF specification in this regard unfortunately.
* Fix gslp.ps with -p optionKen Sharp2022-01-201-1/+19
| | | | | | | | | | | | | | Commit 8d8e90560bf6bbf0415b28445e7d49c005454f77 added a new option 'encoding' which is intended to specify the font encoding to be used instead of always using ISOLatin1. However, the commit broke the output PostScript produced by use of the -p option, and didn't re-encode the default fonts when -p was used, which meant the re-encoding didn't work with the default fonts, only if a specific font was used (-f command line option). This fixes both problems, it's not as neat as the original code, but the previous commit means that ship has already sailed.
* Fix typo in gssetgs.batKen Sharp2021-10-151-1/+1
| | | | | | If a system had only 64-bit Ghostscript installed, and the user had not set the %GSC% environment variables, then the various helper batch files wouldn't be able to find command line Ghostscript.
* Fix Bug 704520. Fix example in viewJPEG to add setting HWResolution.Ken Sharp2021-10-061-1/+1
|
* Resign ghostpdf.cat with the latest certificateChris Liddell2021-09-151-0/+0
|
* Fix Bug 703904. Fix example in viewGIF to add setting HWResolution.Ray Johnston2021-09-021-1/+1
| | | | | The example shown in a comment to set the PageSize from the GIF image size also needs the resolution set to 72 (HWResolution).
* Fix Bug 703916 - Clean up the operand stack in all cases.Alex Cherepanov2021-09-021-1/+3
| | | | Thanks to Alex for this patch.
* Utilities - Update zugferd PDF file productionAdrian Devries2021-08-201-132/+320
| | | | | | | | | Bug #703862 "Feature request: adapt lib/zugferd.ps to newer versions of the ZUGFeRD standard" In the bug Adrian Devries has considerably expaneded on the original zugferd.ps program, fixing a bug or two and adding the ability to choose between production of several different versions of the ZUGFeRD (aka Factur-X) standard.
* Fix gslp.ps -c to handle No EOL case.Ray Johnston2021-08-051-18/+19
| | | | The "Truncate" flag handling did not work with a line with no EOL.
* pdfwrite - improve PDFA_def.ps for --permit-file-readKen Sharp2021-07-291-14/+26
| | | | | | | | | | | The PDFA_def.ps example program needs to read the ICC profile from disk, in order to embed it in the output PDF file. Since the change to security this means the ICC profile must be specified on the command line with an explicit --permit-file-read. This commit puts the file operation in a stopped context and if it fails puts up some text explaining the possible reasons, including the use of --permit-file-read.
* Implement --encoding option for lib/gslp.ps at the request of a customerRay Johnston2021-07-131-10/+23
| | | | | | | | The --encoding option takes effect when the -f or -F options are processed, therefore by having two different --encoding options before to -f or -F, different encodings can be used for the header and body fonts. ISOLatin1Encoding remains the default.
* Fix --detect mode in gslp.ps to handle new-lines in first two charactersRay Johnston2021-06-251-0/+9
| | | | Reported by customer 193
* Sign the ghostpdf.inf "driver" with the latest certificateChris Liddell2021-04-091-0/+0
|
* Update copyright to 2021Chris Liddell2021-03-1558-58/+58
|
* Fix rangecheck from pdf_info when -dDumpXML is used and lines are > 256 bytes.Ray Johnston2021-03-101-15/+2
| | | | Just dump the XML metadata rather than trying to suppress blank lines.
* Fix bug 703557. Replace .sort procedure for use in SAFER modeRay Johnston2021-02-181-0/+22
| | | | Thanks to Peter Cherepanov for this patch.
* Add Page Spot color list to output infoRay Johnston2021-02-181-1/+19
|
* Fix pdf_info.ps "write-doc-string" to handle names as well as strings.Ray Johnston2021-01-071-1/+2
|
* Reintroduce and update cff std strings "encoding" PS fileChris Liddell2020-12-151-0/+117
| | | | | | | | | | | | | and move it to "lib" since we don't actually use it in Postscript any more. It's only used if we ever need to regenerate the C representation of "known encodings". Also, update to include missing strings. Finally, fix the tool that relies on this "encoding" - .namestring is no longer exposed as a Postscript operator, so define a local equivalent. And update the example invocation in the comments
* Fix bug 703270: Wrong path for PostScript helper file in ps2epsiRay Johnston2020-12-141-2/+2
| | | | | | | | | In the change mentioned in the bug, rather than rely on the LIBPATH search method, the ps2epsi script assumed that pd2epsi.ps would be in the same directory as the 'gs' executable, which is not correct. Change to use bare 'ps2epsi.ps' so that it will be found on the LIBPATH as instialled by: make install
* Fix typos in comments of zugferd programKen Sharp2020-10-221-11/+11
| | | | As (mostly) spotted by Lisa Fenn, fix comments in typos and messages.
* New file - program to assist in creating ZUGFeRD electronic invoicesKen Sharp2020-10-191-0/+316
| | | | | | | | | | | | | | | | | While documenting the process for creating a ZUGFeRD invoice from a PDF file and an XML invoice it became clear to me that it was beyond any reasonable expectation of a user to be able to use it unaided. So this program assists in the creation of a ZUGFeRD document. The program requires two command line parameters; -sZUGFeRDProfile= which contains a fully qualified path to an appropriate (correct colour space) ICC profile, and -sZUGFeRDXMLFile= which contains a fully qualified path to the XML invoice file. Example command line is in the comments, and a usage message if the user fails to provide either of the required elements. Obviously the user must also set -dPDFA=3 and -sColorConversionStrategy in order to create a valid PDF/A-3b file.
* Bug 702785: Add UTF-8 encoding for strings in Info dict to pdf_info.psRay Johnston2020-08-271-9/+84
| | | | Thanks to Peter Cherepanov for this change.
* Fix Bug 702014: ps2epsi problems (regression?).Ray Johnston2020-04-244-360/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ps2epsi and ps2epsi.ps were quite a mess, and relied on non-standard operators only available with -dNOSAFER since we made SAFER the default. Even running ps2epsi with -dNOSAFER (by export GS_OPTIONS=-dNOSAFER) had problems -- it could not even convert examples/colorcir.ps to EPSI (throwing an error about colorcirsave). Both of the aforementioned files are replaced with this commit, and the ps2epsi.bat and ps2epsi.cmd are updated to use the new ps2epsi.ps file Also, input files with multiple pages were never correct since the preview was derived only from the first page. The ps2epsi.ps checks if the file is already an EPSF, then don't use eps2write on the input, but warn if the %%Pages comment indicates that there is more than a single page. Note that -dNOOUTERSAVE is needed in the invocation so that if we use eps2write, the 'restore' will close the device and write the tempfile with the EPSF. Then ps2epsi.ps reads the input file, capturing the BBox, stops after %%EndComments, removes any existing preview, constructs a new preview using the 'bit' device with appropriate parameters, writes the preview in the EPSI Preview format (using writehexstring) and then copies the remainder of the EPSF file to the output. The ps2epsi.ps has some checking for valid invocation, since someone may try to use it without the scripts. Since all of the actual conversion is done by the ps2epsi.ps, this change makes windows and linux produce equivalent files.
* Fix gssetgs.bat to use either 32 or 64 bit executables (64-bit preferred).Ray Johnston2020-04-241-0/+3
|
* Update copyright to 2020Chris Liddell2020-04-1055-55/+55
|
* Move pdf_info.ps into lib (from toolbin)Chris Liddell2019-12-121-0/+429
| | | | | | And add it to the list of files to install on Unix systems. Also, tweak the comments in pdf_info.ps to reflect its new home.
* Fix dvipdf scriptKen Sharp2019-10-221-1/+1
| | | | | | Bug #701771 "dvipdf script broken" Apparently the script requires a trailing '-'
* Remove the 136 LL3 font set fontmap filesChris Liddell2019-10-212-1154/+0
| | | | The fontmap for the type 1 136 set is now in the repo with the font files
* Deprecate .setpdfwriteKen Sharp2019-08-133-3/+3
| | | | | | | | | The .setpdfwrite operator nowadays does nothing more than increase the VM threshold, which is relatively pointless so we're going to remove it. In this commit; add a warning message to the .setpdfwrite operator so that anyone using it will be warned. Remove usage from the various shell scripts we provide.
* Fix PDFX_def.psKen Sharp2019-04-031-5/+0
| | | | | | | | Bug #700942 For some reason Git did a merge with this file when I made the change, and it messed it up. Since we don't test these files, it didn't get noticed.
* pdfwrite - change the example PDF/A and PDF/X scriptsKen Sharp2019-04-022-29/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From Bug #700930 "Typo in example command for PDF/X-3 in VectorDevices.htm" The reporter claimed that the (mis-spelled) command didn't work, which was not surprising, since it contained a typo. After fixing the documentation the reporter claimed that the command didn't work. This is true and was missed because of the misleading title. The PDFX_def.ps file was mistakenly pulling the ProcessColorModel from systemdict, which would only be set if this was set on the command line. The real problem is the fact that our setpagedevice/currentpagedevice code doesn't truly reflect the device setup, so changes to the ProcessColorModel caused by setting ColorConversionStrategy are not reflected in the values returned by currentpagedevice. This commit updates PDFX_def.ps to chaeck the ColorConversionStrategy instead, which is more reliable, and then use the ProcessColorModel from the currentpagedevice as a fallback if ColorConversionStrategy is not set. (actually this should not be possible) Update PDFA_def.ps similarly; although it was using the currentpagedvice this is not a reliable method. Finally; reformat the files, add some extra comments describing what the code is doing, make it clearer that these files *should* be customised and add additional some basic instruction on customising them.
* Documentation changesKen Sharp2019-04-011-1/+1
| | | | Bug #700930 "Ghostscript - Typo in example command for PDF/X-3 in VectorDevices.htm"
* Fix lib/pdf2dsc.ps to use documented Ghostscript pdf procedures.Ray Johnston2019-03-191-12/+5
| | | | | We eliminated GS_PDF_ProcSet and pdfdict, but runpdfbegin, dopdfpages, and runpdfend are still available.
* Change shellarguments to .shellarguments and document it.Nancy Durgin2019-03-0711-12/+12
|
* Update source/header file copyright notice to 2019Chris Liddell2019-01-1656-56/+56
|
* Bug 699744 "ps2epsi fails with Error: /undefined in --setpagedevice--"Ken Sharp2018-09-084-8/+7
| | | | | | | | | | | | | Recent changes required to harden SAFER mode mean that it is no longer possible to run this script in SAFER mode, because it relies upon unsafe Ghostscript non-standard extension operators. Removing SAFER and DELAYSAFER, and the code to reset SAFER, allow the program to run as well as it ever did (ie badly). This program should now be considered unsafe, you should not use it on untrusted PostScript programs. I think its likely we will deprecate and remove this program in future.
* Bug 691725: Tweak gssetgs*.bat files.Robin Watts2018-09-063-3/+24
| | | | | | | | | The existing scripts assume that the gs binaries are on the path. The tweaked scripts check to see if there is a binary in the same directory as the .bat file, and if there is, use that in preference to any version on the path. Otherwise functionality is identical.
* Update signed ghostpdf.cat to new certificateChris Liddell2018-09-051-0/+0
| | | | | also add a *.cat rule to .gitattributes to ensure .cat files are always treated as binary
* Update copyright notice with new head office address.Ken Sharp2018-01-3059-352/+173
| | | | | | | | | Also update copyright dates. Remove gs_cmdl.ps as we no longer use it, and remove its entry from psfiles.htm. Remove xfonts.htm as this feature (xfont support) is long, long gone.
* Add PWGDecode filter.Robin Watts2017-12-131-0/+251
| | | | And lib/viewpwg.ps to use it.
* Add support to viewpbm.ps for GRAYSCALE and RGB_ALPHA and fix logic for FITPAGERay Johnston2017-11-021-14/+27
| | | | | | | The RAW_DUMP with RAW_DUMP_AS_PAM emits RGB_ALPHA and GRAYSCALE but these were not supported. Display RGB_ALPHA as CMYK for now. Also if SCALE was specified, the ifelse for FITPAGE was inverted.
* Fix viewpbm.ps FITPAGE SCALE optionRay Johnston2017-07-061-1/+1
|
* Tools - remove ps2ascii.ps, recode scripts to use txtwriteKen Sharp2017-06-194-1543/+10
| | | | | | | | | | | | | | ps2ascii.ps uses DELAYBIND, which we would like to get rid of, in addition it doesn't do a terribly good job of actually extracting text. The txtwrite device is more sophisticated, although it does not have the added 'COMPLEX' feature of ps2ascii.ps which emits strokes and fills as rectangles. If the COMPLEX feature set should prove useful enough it would be easy to add this functionality to a new device, but in reality I doubt anyone is using this. The scripts specifically set -dSIMPLE. This allows us to deprecate DELAYBIND and in future remove it.
* Renove or modify many files from lib and toolbin that are no longer usefulKen Sharp2017-05-1330-3898/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused packfile.ps and gs_pfile.ps file from lib -------------------------------------------------------- The PostScript claims to 'Pack groups of files together, with compression, for use in storage-scarce environments.' It also states that it 'must be kept consistent with gs_pfile.ps' which says it is 'Runtime support for minimum-space fonts and packed files' I've never heard of either of these being used, they aren't used in the ROM file system and it seems unlikely these days that there is a great deal of call for minimising file sizes. If these should need to be reinstated, note that they use .setglobal .currentglobal and .computecodes. At the time of this commit these operators were being deprecated and hidden though the C support is retained. If the C code is later removed then these library files will not work. Remove font2c.ps ----------------- If we want to build a font into C and link it, we have the ROM file system in place to do so. This no longer seems useful. remove font2c Remove impath.ps ----------------- The apparent purpose of this code is to take a bitmap (scan ?) of a glyph and turn it into a PostScript type 1 font form, presumably in order to make a font. This doesn't seem hugely useful, and seems to me at least borderline illegal depending on jurisdiction. We also want to remove, or at least disable, the .imagepath operator which this program (and only this program) relies upon. If we ever need to re-instate this program, we will also need to reinstate .imagepath Remove pdfinflt.ps and pdfwrite.ps ----------------------------------- pdfwrite is only (as far as I can see) used by pdfinflt.ps which says: % It is not yet ready for prime time, but it is available for anyone wants % to fix it. % % The main problem is: % % 1. Sometimes the PDF files that are written are broken. When they are % broken, GS gets an xref problem. % % This problem is actually due to lib/pdfwrite.ps since even % when no conversion is done, the file is may be bad. Since it doesn't work, and we can use MuPDF (which does work) for the same task, I've chosen to delete both these files. Remove unprot.ps wrfont.ps --------------------------- unprot.ps 'disables access checks' according to the comments in order to print out eexec-encrypted type 1 fonts. Since this could, presumably be used to read a noaccess dictionary and dump type 1 font outlines it is of dubious legality. (see the comments in wrfont.ps) wrfont.ps is used to decode a type 1 font, we have better tools for decoding fonts so this file seems mostly useless. By the same reasoning we don't need type1ops.ps or type1enc.ps Remove addxchar.ps ------------------- This was used to add extended Latin characters to a font. Our fonts now contain all the standard glyphs that Adobe fonts do, we don't want to go back down the route of adding (and maintaining) poor quality additional glyphs to the fonts. Remove decrypt.ps ------------------ Yet another way to decrypt a type 1 font. In addition to dubious legality we have better ways to do this. Remove pcharstr.ps ------------------- Again, we have better tools for doing this job and the legality of this tool is debatable. Remove markhint.ps ------------------- We believe we now have better tools for dealing with fonts than this. Delete level1.ps ----------------- A fairly pointless file. Remove smoke.ps from toolbin ----------------------------- Our current testing method is much more thorough. Remove bughunt.sh ------------------ A 'user contributed file that has not been kept current', since 1995 apparently. I can't believe this is still useful. Remove pstogsf.bat ------------------- I'm fairly certain this is long defunct. Remove showchar.ps ------------------- another font-related utility, we've deleted the programs it reliee on, so.... Remove wftopfa --------------- Wadalab fonts, given these were uploaded by Werner Lemberg I'm as sure as possible that we don't need these utilities to work with these fonts. Remove markpath.sh ------------------- seems like a moderately pointless file; since it uses flushpage, which I want to hide, remove it. Remove quit.ps --------------- Seriously ? A file which just contains 'quit' ? Modify various of our utilities to not use Ghostscript extension ops --------------------------------------------------------------------- We want to hide various of our extension operators, these files used .devicename, .rectappend, .currentglobal, .setglobal and .namestring Replaced .currentglobal/.setglobal with currenglobal/setglobal Replaced .rectappend with a simple PostScript path Replaced .devicename with currentdevice /Name get Replaced .namestring with 1024 string cvs Remove EndOfTask.ps -------------------- Just a Ctrl-D Remove gs_rdlin.ps ------------------- Linux 'readline' support, just sets prompt to nothing Remove showpage.ps ------------------- just contains 'showpage'!
* ps2epsi - reapply fixKen Sharp2017-05-121-1/+3
| | | | | | | | | | | | | Bug #697890 "Bug 689832 still unresolved in master" The fix for this was applied (contrary to the report in 697890) but it was later removed as part of the fix for bug #688500. I presume this was accidental, since 688500 predates 689832, but the fix was applied later. I don' know how this happened and after 8 years I don't propose to worry about it. Just reapply the fix for 689832