summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix SEGV with -r300 -dMaxBitmap=3g comparefiles/Bug692688.pdf DeviceN devicesRay Johnston2021-08-221-28/+28
| | | | | | | There are several places where we overflow a signed integer calculation of "planestride * comp_num" when the transparency buffer exceeds 2Gb when doing the alpha blending suring put_image. Fix by forcing the calculation to uint64_t.
* PCL: Update windows call sequence to match linux.Robin Watts2021-08-201-0/+12
| | | | | | | | | | | Linux sends a UEL at the end of a job, windows does not. This causes files that end in (for example): <UEL>@PJL LPORTROTATE (with no trailing return) to give an error. Windows and linux now behave the same.
* Fix SEGV seen with ps3cet/09-59.PS and the ijs deviceRay Johnston2021-08-201-1/+1
| | | | | The ijs device initialize_device proc allocates memory, thus the dev->memory must be set up prior to this call in gx_device_init.
* 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.
* Bug 703899: Don't overwrite explicit FontBBoxChris Liddell2021-08-191-1/+8
| | | | | | | | | | | | | | | | | | | | The FAPI "refined" (replaced!) the FontBBox with one read from the FAPI server. For example, with TTF it will use the values from the "head" table. That is required, to get an accurate bounding box for, for example, TTF fonts or MicroType fonts. But it can cause problems in certain cases: one is when a Type42 font includes a "customised" FontBBox for specific purposes (which may not be strictly "legal" but should work). In a case more in-line with the spec, the values from the TTF "head" table will be drawn from the complete, original font, which may not be accurate for a subset font. Type 42 and Type 1/2 fonts are *always* serialized in the FAPI API, never handled as a file or full font buffer. So, this changes FAPI to only do the "refinement" when it's dealing with an entire font (either in a memory buffer, or direct from a font file).
* pdfi: Handle invalid encodings in TTF font objectsChris Liddell2021-08-191-1/+5
| | | | | If the font is symbolic, just ignore the invalid encoding. If not, return an error (as before).
* Bug 703722: Broken name table in TTFPeter Cherepanov2021-08-191-4/+8
| | | | | | The problem is caused by incorrect name table in the font. Following the existing case of 0-lenth table, this patch quietly returns "not found" if the search fails for any reason.
* Bug 703947: correct the PPC definition of ARCH_SIZEOF_SIZE_TChris Liddell2021-08-191-1/+1
| | | | It had been mistyped as ARCH_SIZEOF_SIZET
* Bug 703948: move pragmas out of function bodyPeter Dyballa2021-08-191-11/+4
| | | | | Older gcc versions give the error: "#pragma GCC diagnostic not allowed inside functions",
* Add header include to fix missing prototype error/warningChris Liddell2021-08-191-0/+1
|
* Fixes and improvements to Java build scriptsEthan Vrhel2021-08-186-12/+21
| | | | | | | | Fixed on Windows, Linux, and Mac where the build scripts would use the wrong manifest file. The Windows build script for gsviewer now builds and copies gsjava. Updated READMEs to reflect these changes.
* Bug 703841: Fix incorrect disabling of anti-aliasing in java bindings.Julian Smith2021-08-181-2/+2
| | | | | To turn off aniti-aliasing need to set TextAlphaBits and GraphicsAlphaBits to one, not zero.
* Bug 703688: Fixed minor typos in Java code.Julian Smith2021-08-181-4/+4
|
* pdfwrite - PDF/A - permit non-XMP entries in Docinfo to contain escapesKen Sharp2021-08-181-1/+26
| | | | | | | | | | | | | | | PDF/A requires that the XMP metadata and the Document information dictionary entries which have corresponding XMP keys must be the same. Byte for byte the same. This means that characters in document information dictionary strings which must be escaped, or represented in octal, can't be used. However, 'arbitrary keys', as defined in the pdfmark reference, do not correlate with keys in the XMP Metadata and do not need to conform to this restriction. This commit checks the keys to see if they are XMP keys before checking to see if they need to be escaped.
* Fixes spelling of "Ghostscript" as well as some other small typosJamie Lemon2021-08-182-17/+17
|
* pdfwrite - strip trailing NULL from 'special' pdfmark namesKen Sharp2021-08-181-0/+2
| | | | | | | | | | | | | | | | | | | Bug #703787 "Extending the catalog /Names entry" The bug is nothing to do with the actual description :-( If a name for a Key/Value contains 'non regular' characters then it is converted to an internal form with two preceding and one terminating NULLs. I don't know why we do this, I don't really believe it's required (as noted in gdevpdfm.c line 875). However I'm loath to alter it without a good reason because there is no practical way to test this. When emitting that name, the pdfmark code stripped the two preceding NULLs, but omitted to strip the terminating NULL, leading to an invalid string, in this case for the /Dest. Strip the terminating NULL as well to avoid this.
* Coverity 372501: Add 'fall through' note for switch.Robin Watts2021-08-181-0/+1
| | | | | | | This came from an expanded version of the BEGIN_ARRAY_PARAM/ END_ARRAY_PARAM macros. Interesting that it didn't complain about them in macro form (or maybe someone has marked the macros in coverity already?)
* Nup: Remove some stray '\' chars left over from expanding a macro.Robin Watts2021-08-181-5/+5
|
* Revert "Add gxdso_upcall mechanism, and use it in Nup device."Robin Watts2021-08-185-56/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2103d52da9519ded2af60f10aceab0ecd74da6a8. While the concept of using 'upcalls' works, in that "higher" devices can be correctly informed of changes in "lower" devices, it hits problems in what you can actually do when the upcalls happen. In this instance, we have an Nup device subclassing an epo device subclassing a png16m device. Then png16m device spots a change in mediasize, and so has to reallocate the memory its using. So it sends an upcall. The Nup device recieves the upcall, and decides to act on it, by flushing the nest, thus sending outputpage to the epo device. The epo device sends the fillpage and outputpage on, and unsubclasses to remove itself from the chain. Due to the nature of unsubclassing the png16m device moves from it's current allocated block INTO the block previously used for the epo device. The old block is then freed. Upon return from the upcall, the png16m device tries to actually do the realloc that it had been signalling for, but the pointer it was holding is out of date, and we crash. We have so far been protected from this by the fact that we're always picking up the reallocs before they happen, and so nothing happened on the upcalls. Attempting to remove that code showed up the problem. So we remove the upcall code entirely and will rely on the old method of spotting parameter changes. If inspiration strikes us as to how to make this work safely, we can pull this back out of git.
* demos/python/gsapi.py: fixed/improved some fn comments.Julian Smith2021-08-181-16/+47
|
* Begin documenting the new PDF interpreterKen Sharp2021-08-183-12/+187
| | | | | | | | | | | | Document its existence! Add notes about NEWPDF Document those PostScript functions that we (or I) have promised to maintain. Still to do: document the new PostScript operators for the new interpreter, come up with some example programs
* Updated .gitattributesEthan Vrhel2021-08-171-2/+1
| | | | | | Allowed .md file (Java .jar manifest files) to have blank lines at the end of the file; this was required by Java to be a valid manifest file.
* Updated READMEsEthan Vrhel2021-08-174-16/+44
|
* Added install.sh for gs_jni projectEthan Vrhel2021-08-1718-22/+47
| | | | | | | | | | | | | | | | | | | | This script installs the required libraries in /usr/lib so projects using it can be run. Fixed build scripts on Mac Added install_darwin.sh and fixed start_darwin.sh allowing Mac instances of the viewer to run correctFixed build scripts on Mac Renamed Manifest.txt files to have .md extension This will be to allow newline characters at en of line, and to match the internal extension of Java JAR manifest files. Updated names of build scripts Done to improve clarity of which scripts are used for which operating system.
* Added build scripts for Mac OS XEthan Vrhel2021-08-177-3/+169
| | | | | The build scripts are named the same as the Linux build scripts except they are suffixed with "_darwin".
* Fixed an issue regarding a variadic functionEthan Vrhel2021-08-171-1/+12
| | | | | | in callbacks.cpp, a JNI function was being called requiring variadic arguments. The function was passed a non-primitive type (a Reference object). Fixed by calling its object() member function.
* Temporarily fixing whitespace issuesEthan Vrhel2021-08-171-0/+3
|
* Add simscale.dev to pdfi dependenciesChris Liddell2021-08-171-1/+1
|
* Tidy up the pdf_utf8.c buildChris Liddell2021-08-172-3/+18
|
* Add some quoting, for consistencyChris Liddell2021-08-171-7/+7
|
* Split writing to font key_name and font_nameChris Liddell2021-08-171-0/+3
| | | | | | | | Prompted by a Coverity report: fonts contain a key_name and font_name entry which, in theory, can be different, but in pdfi (currently) never are. Nevertheless, it makes sense to ensure the buffers are sufficient individually, rather than assume the two are, and always will be, the same.
* Coverity ID 372266: Validate charstrings index sizeChris Liddell2021-08-171-1/+1
|
* Coverity IDs: 372338/372317Chris Liddell2021-08-171-1/+4
| | | | Move null pointer check to the start of the function.
* Coverity ID: 372337Chris Liddell2021-08-171-1/+5
| | | | Ensure we've created a valid C string before making a PDF name out of it
* Coverity IDs: 372336/372253Chris Liddell2021-08-171-1/+4
| | | | Moving the null pointer check hopefully keeps coverity happy.
* base/gsbitops.h: removed spurious backslash.Julian Smith2021-08-161-1/+1
|
* Revert two incorrect changes in pdfi commit.Julian Smith2021-08-162-3/+4
|
* toolbin/localcluster/clusterpush.pl: added muwasm.Julian Smith2021-08-161-0/+1
|
* Fix pdfi+GS with spot capable devicesKen Sharp2021-08-164-8/+28
| | | | | | | | | | | | | | | | | | | | This is a chain of problems. Firstly we were unconditionally setting the 'init_graphics' parameter to pdfi_check_page() which caused it to close and reopen the device. This throws away the Media Size, CTM and any cropping/rotation etc which we set up in the PostScript world. Resolving that then showed that we were not resetting the number of spots on each page. Resolving that then showed up a failure to determine that a device was spot colour capable, because we were doing the pdfi_check_page() call to retrieve the per-page transparency and spot information when the PDF graphics state wasn't pointing to the PostScript graphics state, which meant we were using the nulldevice. This commit fixes all of the above problems. The various spot-capable devices now render their content to the correct size/orientation/clip and get the correct number of spots.
* Don't return a value from a void functionKen Sharp2021-08-161-1/+1
|
* Fix wrong length parameter.Henry Stiles2021-08-161-3/+3
| | | | | Norbert Janssen spotted this regression with fixing 703885, see comment #14 in the bug.
* Add gxdso_upcall mechanism, and use it in Nup device.Robin Watts2021-08-165-0/+56
| | | | | | | | | | | | | | | | Here, we add a generic mechanism for child devices to send information to parent devices, and introduce the first use of it. Using the dev_spec_op mechanism, together with the 'parent' pointers kept for subclassing, we define a new 'gx_upcall' function that sends information up to the topmost device (where it can then trickle down again using the usual dev_spec_op handling). We define the first such use of this facility as being the 'gx_upcall_device_realloc' event. This should be sent by a device just before it reallocates the memory it is using for the page buffer. This allows the Nup device to spot this, and know that it should flush the nest to avoid rendered pages being lost.
* Fix pdfi merge "errors".Robin Watts2021-08-162-4/+2
| | | | | | | | | | | | | | In merging master to pdfi in the past, it appears a couple of changes got dropped by accident. Reintroduce them here. Firstly, in gdevp14.c, Michael had removed the gx_device *dev param to pdf14_find_backdrop_buf as it was unused in commit b1ac0686eea6adcf ("Bug 702117 Knockout groups containing non-isolated groups"). Secondly, in gdevppla.c, I'd removed a blunt force memset in favour of a more nuanced check in commit: e21027b895f3 ("Better fix for psdcmyk indeterminisms").
* Nup: Remove stray parameter.Robin Watts2021-08-161-5/+5
| | | | | We never use the 'flush' parameter to nup_flush_nest_to_output, so remove it.
* Nup: When Nup is in use, force PageUsesTransparency on.Robin Watts2021-08-162-55/+102
| | | | | | | | | | This prevents us suddenly having to flush the nest when PageUsesTransparency changes. This would otherwuse result in unexpected changes in the way pages are laid out. This obviously affects whether we use clist or not in some cases, but does not (currently at least), I believe, cause extra work with transparency blending.
* Turn off debugging switchKen Sharp2021-08-161-1/+1
| | | | | This got turned on, and accidentally left on, in the pdfi branch. Turn it off again.
* txtwrite - initialise some structure membersKen Sharp2021-08-161-0/+3
| | | | | | These are freed when the text enumerator is released, they need to be set to NULL so that we don't try and free uninitialised pointers if we never received any real text.
* Coverity ID 372280 and 372303Ken Sharp2021-08-161-2/+2
| | | | | Properly calculate the size of the spot function table for us as a loop counter bounds check.
* Remove an unused labelKen Sharp2021-08-161-1/+0
| | | | Silences a compiler warning
* Coverity ID 372256Ken Sharp2021-08-151-3/+0
| | | | Drop calculation of offset which will be overwritten.