This document discusses the CentraDoc changes since 6.1. If you haven't upgraded since 6.0, please read the 6.1 changes document as well.
Liberty has been using a ticketing system for issue tracking since before the 6.1 release. This should help clients keep track of what specific issues have been addressed. Most of these notes will be listed by ticket number. (Liberty uses Subversion and Trac)
Here are the highlights for CentraDoc 6.2:
This document is current as of the 6.2.1 Release
#286 Massive Safety / Security cleanup
- Handle all Visual Studio 2005 deprecations
- Fixed a variety of bugs found by cl /analyze
- Error-prone standard C functions like strcpy and sprintf have been completely removed and replaced with safe versions.
- Change temporary file mechanisms for Windows Vista compatibility
- Significant safety enhancements to runtime library use.
- Other safety patches for Jasper, Little cms, FreeType and JPEG libraries
- Extensive source changes to clean up symbol conflicts and other problems with includes.
- Standard fixed-size integer symbols (stdint.h style) are used for consistency
- Many include files and symbols in the gco core have been renamed with package prefix rt_
- rt_config.h is the include file to customize for any needed #defines This should not be necessary except in unusual circumstances
- psi.h has been reorganized to resolve dependency loops and provide a narrower interface
#204 Fix handling of special conics when getting FreeType outlines for fonts
#206 Shader artifacts from too-early parametric color convergence
#248 Error handling
gco/errmgr.d is now the root of all errors.
There are two categories of error identifiers: simplified general errors and extended specific errors.
The simplified errors are a small set of enum values that could be meaningful to a user in the most general sense. The extended errors use string atoms for short, meaningful error names that map readily to longer error definitions. This removes the need to manage some large arbitrary "error number" space across subsystems.
The PSI and PvSDK API interfaces were both inconsistent about error return values. The PvSDK and PSI calls now return simplified error values, although a negative return may have special meaning for some calls (all the simplified errors are small positive integers).
Extra TRY wrappers have been added around the main PSI functions: psiint, psimon, and psifin, to be sure exceptions don't escape to the application.
Here is the enum for the simplified errors:
typedef enum etSimpleError { errorNone=0, errorFailure, /* unexpected, assert, gpf, ... */ errorUndefinedResult, /* divide by 0 or other */ errorOutOfMemory, errorDiskFull, errorUserAborted, errorFileNotFound, errorFileExists, /* if unexpected... */ errorAccessDenied, /* Permission error */ errorPasswordRequired,/* try again with correct password */ errorInputOutput, /* "device failure" */ errorInputSyntax, /* data / syntax / encoding */ errorInitializing, errorUnsupportedVersion, errorUnsupportedFeature } ESimpleError;The PS_CONFIG (psc) struct contains detailed information about what errors have occurred:
char * error; /* Current error */ int signalerr; /* cleaned and Signalled error value */ struct { char *raw; /* thrown error */ char *PostScript; /* in PostScript error space */ int simple; /* simple erorr space */ } last_error; /* most recent error being handled */
Normal image processing converts images to 8 bit driver native color. For gxc->image_raw_data, the image format will convert to non-indexed 8 bit but preserve the target color space.
If the driver fails the DvImgStr by returning non-zero, the image will finish cooking to driver native color and try again. #306 adds gxc->image_raw_indexed, which will first give the driver a shot at the indexed data; again, the driver can fail the DvImgStr, and the image data will be converted to non-index and DvImgStr tried again.
#311 More rgn oddities: ClipPath not handling trailing move
fonts.dat was loaded in 2 different places - fntft.c and psfont.c - and psfont.c reparsed the file for every query. Now only loaded once, in fntft.c
alias /original
Support for one leading %environment% variable in font path, needed to support %SystemRoot% for default Windows fonts.
The software now works under Windows without psc->etc_path or the etc Type 1 fonts
The default font map under Windows is now:
% standard PDF (and PostScript) fonts Times-Roman %SystemRoot%\FONTS\times.ttf Times-Italic %SystemRoot%\FONTS\timesi.ttf Times-Bold %SystemRoot%\FONTS\timesbd.ttf Times-BoldItalic %SystemRoot%\FONTS\timesbi.ttf Helvetica %SystemRoot%\FONTS\arial.ttf Helvetica-Oblique %SystemRoot%\FONTS\ariali.ttf Helvetica-Bold %SystemRoot%\FONTS\arialbd.ttf Helvetica-BoldOblique %SystemRoot%\FONTS\arialbi.ttf Courier %SystemRoot%\FONTS\cour.ttf Courier-Oblique %SystemRoot%\FONTS\couri.ttf Courier-Bold %SystemRoot%\FONTS\courbd.ttf Courier-BoldOblique %SystemRoot%\FONTS\courbi.ttf Symbol %SystemRoot%\FONTS\symbol.ttf ZapfDingbats %SystemRoot%\FONTS\mtsorts.ttf % aliases for Windows standard, look out for spaces Arial /Helvetica ArialBold /Helvetica-Bold ArialItalic /Helvetica-Oblique ArialBoldItalic /Helvetica-BoldOblique TimesNewRoman /Times-Roman TimesNewRomanItalic /Times-Italic TimesNewRomanBold /Times-Bold TimesNewRomanBoldItalic /Times-BoldItalic CourierNew /Courier CourierNewItalic /Courier-Oblique CourierNewBold /Courier-Bold CourierNewBoldItalic /Courier-BoldOblique
The default font map for other platforms remains unchanged (uses the etc T1 fonts).
#355 (part 2) SmarterTransform=Y color manager operations buggy
#355 (part 3 and 4) Issues with image masks and image emulation
Ticket-less:
Fixed interesting nasty bug in FFsBase Create File. If create failed, it opened the output file in the etc_path directory.
Fixed monochrome image resizer to work correctly when reading multiple rows
Added polygon winding information to DvClip
Validate function Type 0 sample count and Validate get samples parameters
Removed some unused FreeType driver modules.
Updated FreeType to 2.2.1
Updated Little cms to 1.15
Updated zlib to 1.2.3
#2 PDF Transparency
The new RIP implements PDF transparency
High level transparency hooks have been added to the Driver Interface
Alpha and Blend Mode values have been added to the Graphic State
Note that the page-level blend mode hack from ticket #74 has been disabled, because it interferes with correct transparency function. If this feature is still desired for some drivers, an option can be added to re-enable it.
#118 More efforts to detect bogus PDF font encodings
#119 Specific PDF file has overlapping characters due to incorrect default width for Type 0 fonts
#123 DvImageGrab no longer allows grabbing JPEG with Lab color space
#136 Improved handling of layer expressions
#139 Unicode strings in PDF file structure calculated length incorrectly
#144 External fonts pretend to be embedded to avoid forced driver substitution
#146 Choose correct encoding for Symbol,Italic and other Symbol related fonts
#147 JBIG2 potential crash reading past end of buffer
#150, #154 Gradient clip rectangle could get stuck
#156, #107 Correctly handle pathological dithering patterns
#168 Handling broken XRef counts in some defective input files
#169 Make sure dash segments are at least 1 pixel long
#173 Ignore ToUnicode map if low ASCII duplicates found in map
#177 Pattern fill of empty path caused nocurrentpoint exception
#183 Create on-the-fly appearances for fill-in form fields
#188 Image mask emulation and character emulation conflicts
#194 Outline reader chokes if pages haven't been referenced yet
#196 Dashed styles lost if matrix is whacky (whole page == 1. x 1.)
#201 Handle obscure FontDescriptor flag AllCap
#217 Make RLC decode more forgiving if end of input
#219 Attempt to detect uniXXXX glyph names for generating an encoding
#258 PDF layer bombs for degenerate OCMD with no OCGs
Actual value is an int, and the enum is changed so 1 == CropBox. Sometimes client needs to use TrimBox or ArtBox.
Also, in psbbox check for %PDF header and skip the file (AI files have embedded PostScript producing false positive for %%BoundingBox)
#325 /XRef /Index not parsed correctly (PDF Object Streams)
#341 Handle unbalanced q/Q on PDF input by flushing at end of page
#348 Saturation blend mode mis-spelled, causing not found error
Ticket-less:
PSI API hooks for PDF passwords:
/* returns true if PDF file is encrypted */ int psiispdfencrypted(PS_CONFIG *psc); /* this returns PDF permissions based on password - see PDF.d 0 means password failure */ int psipdfauthorize(PS_CONFIG *psc, char *pwd);
via DvFontEm / DvCharEmStart / DvCharEmEnd
See also #11 above.
#115 Distiller losing font if capturing emulated font
#133 PDF Write sets /M (modification date) entry for all text annotations
A new module in the PDF Update library, pdfupd/pdfa1b, has a function:
void Pdf_Make_PDFA1b(PdfDoc *doc);
which will place an sRGB profile in the PDF file, and place XMP markers in the file for PDF/A-1b compatibility. Note: This does not mean the file will actually be PDF/A-1b compatible! PDF/A has many restrictions that must be followed to produce a compatibile file. Adobe Acrobat has an Advanced/Preflight tool that can be used to verify compliance with PDF/A-1b. Please refer to the PDF/A Specification, or contact Liberty Systems for more information.
#155 Fixed buffer overflow on CCITT compress
#197 Correct measurement of text for PDF output annotation bounding box
#228 Add PDF_ShowWideText to the PDF Output API
#336 Create encryption broken in revision 5349 (11/11/2005)
Ticket-less:
JPEG image target turn off any row padding or bad things happen
For PDF write API BT and ET are automatic, so BT has to restore the current text matrix
Do form wrote the do twice
Begin form reset bbox to specified causing a problem
Use any pattern referenced by shader, to avoid possible leakage
Added PdfStreamDeferred for caching output instead of interrupting page contents
Distiller fonts always need PSDVFONT origmtx
Distiller receiving DvChar if no Type 1 fonts available, return best-guess rectangle
Orient wasn't plugged into the PvSDK LS_ Distiller calls
#134 makefont cache could mess up Encoding array
#174 DistillerParams set /CoreDistVersion to 5000 (or pdfmark won't execute)
#187 copypage operator wrote to random stack location (ouch)
#195 Fix handling of degenerate arcs
#228 PostScript some odd page sizes added for specific client
#251 Infinite loop in pathforall operator (ouch)
#271 Fixing special case of embedded Type 0 font
PostScript allows write access to the file system; this could be a source of mischief. Most PostScript files don't do any writing, but some write out temporary files that contain PostScript sub-programs.
psc->ps_write_path now controls where PostScript can write to; any files created are created in this location. By default, psc->ps_write_path is set to psc->etc_path + "tmp", although this is potentially a problem under Windows Vista.
#306 See #306, above
#315 Work around for "forgetting" dbcs for driver override of embedded font
#321 Dummy /SpotFunction needs to at least behave properly.
Ticket-less:
image_mask = 0 caused all PostScript images to emulate.
Add RRCustomProcs setjobtype to handle Xerox document
For ps_ispsfile 1024 bytes was not enough, increased to 4096
Don't choke if /Decode is missing from image dictionary
Changed default substitution font from Courier to Times-Roman
pstack and stack had stopped working
#148 WMF and Placeable WMF output removed from PvSDK - unsupported
wide GID_CHARSET fonts; this is in the Windows driver, but also affects the distiller. This set of changes is complex - more information is available if needed.
ini setting for PPDDefaultEncoding= to control default wide encoding / locale
for encoding CMaps, also look in the unadorned etc path
Distiller can now reference external Windows fonts
The Distiller now supports AlwaysUseEmbeddedFonts (gxc->embedded == 0) so it's now possible to override embedded fonts if desired.
Windows now has HFONT[#]= and VFONT[#]= ini settings to override the Unicode/dbcs font search. [#] is the charset (gfx/encoding.h), H/V for horizontal or vertical for example:
HFONT[134]=SimSun
to force SimSun as the Chinese font.
PPDDefaultEncoding= can be a problem for any "normal" PostScript fonts; any normal encoding manipulations are ignored. Disabled for embedded fonts.
Apparently GlyphNames2Unicode would help, but we don't use it yet
#310 initial clipping clobbered when printing
Adding LS_GetCap so sample.exe can ask if distiller is available deletes menu items instead of disabling them, to avoid confusion.
Print warnings in release mode if swallowing a hardware error NO_FAILURE_STDERR can turn them off - see rt_config.h
psijpg EMF creation: get extents or bad things will happen
The RIP has been completely replaced. This uses a newer AntiGrain (2.4) as well as a new driver architecture called VITAL. The new RIP has extensive support for the PDF Transparency model.
Several bug reports that were fixed in the branch are no longer relevant; Other issues may require revisiting in the new architecture.
Some features that are not present in the new RIP: The old RIP supported direct CMYK rendering, although this was never used by any customers. The old RIP also had special support for fat pixels (16 bits per component) and very wide lines (> 32767 pixels). This is for a specific customer, and will be added to a RIP update in the future.
riptest Added dpi and page size to command line parameters
Previous RIP bugs:
#126 Aliasing options and related bugs
#129 Fixing holes in gradients
#351 Part 1 - Transparency glitch - funky alpha math
The driver interface consists of:
- The Interpreter Context: PS_CONFIG (psc)
- The Driver Caps: PSDEVCAP (gxc),
- The Graphic State: PSGXSTAT (gxs)
- The driver call parameter constants and structs.
- Any other portions of the PSI API that might be referenced by the driver
#248 pserr.h is now generated from psio/pserr.d
the PSI include files have been reorganized.
psi.h and psgxs.h have been split into:
- psibase.h - low level PSI types and defines like PS_OBJECT
- psix.h - PS_CONFIG (psc) and PSDEVCAP (gxc)
- psgxs.h - PSGXSTAT (gxs) and all the driver constants and structs
- psi.h - full interface, just includes other files
#324 gxc->clip_rect is now float
PS_CONFIG is defined in psix.h
changed:
char * error; /* Current error */ int signalerr; /* cleaned and Signalled error value */
and added:
struct { char *raw; /* thrown error */ char *PostScript; /* in PostScript error space */ int simple; /* simple erorr space */ } last_error; /* most recent error being handled (overkill) */
added:
char * ps_write_path; /* force file write operations to be in this area */
changed the meaning of:
int pdfCropped; /* pdfdoc::PgExtType */
added some fields for internal use:
PS_DICT * last_font_dict; int parsingCustomColors; /* parser flag */ int makingDuoTone; /* cspace.c flag */ FFsPtr run_file; /* debugging, and DvImgGrab check `#316`_ */
removed some fields no longer in use:
int in_text; /* In text rendering */ int in_getchar; /* In the middle of getchar */ int in_charem; /* already capturing character (DvCharEm) */ int *time_count; /* Pointer to time counter */
PSDEVCAP (gxc) is defined in psix.h
Important read #166 PostScript now recognizes gxc->multichar == 0.
adds:
int use_winansi; /* use WinAnsiEncoding for driver fonts, instead of StandardEncoding */
adds:
int image_raw_indexed:1; /* Device wants raw image data AND indexed (requires both!) */ int want_duotone; /* #306 turns on duotone logic (and DeviceNSeparations) */
which extends the meaning of image_raw_data
changes:
FRECT clip_rect; /* Device default clip rect */
This flag will substitute explicitly masked images in place of stencil masked images:
int image_explicit4stencil; /* emulate stencils using explicit masks; requires image_mask=1 */
These flags enable new driver Dv calls:
int want_BT_ET; /* send DvBegin/EndText */ int want_xpc; /* send XpcGroup and SoftMask calls */ int want_imgsrc; /* send DvImgSrc - return 0 if grabbed */
The auto tiff logic (client specific) is enabled by:
int auto_tiff; /* enable PostScript Automatic tiff detection */
PSGXSTAT (gxs) is defined in psgxsh.h
These fields are part of the transparency model (#2):
int blend_mode; /* PDFREF 7.2.4 */ float stroke_alpha; /* PDFREF 4.3.4 */ float fill_alpha;
While alpha is part of many of the driver parameter structs, this is the only place to pick up the blend_mode.
DvImgSrc (requires gxc->want_imgsrc)
PSDVIMGS adds the image_source (gfx/imaging.d Class ImageSource) parameter which can be read by the driver instead of using DvImgRow and DvImgEnd. (By convention, if DvImgStr returns < 0, the driver has handled the image.) However, at DvImgStr time, the image data isn't fully cooked, which can put additional burdens on the driver. DvImgSrc is another chance for the driver to use PSDVIMGS image_source to grab the image, after the image format and color space have been cooked. If the driver sets gxc->want_imgsrc it will receive DvImgSrc; if the driver handles the image, it should return 0.
DvBeginText and DvEndText (requires gxc->want_BT_ET)
For PDF, sends these driver signals on BT and ET operators, to help organize text input. There is no equivalent for PostScript.
Transparency (requires gxc->want_xpc)
This set of driver calls support the PDF transparency model. The model is quite complex, and beyond the scope of this document. If you are interested in implementing transparency, please see The PDF Reference, and the current RIP implementation. The source file psgxs.h has the detailed definitions for the parameter blocks.
which are used specifically by the Distiller to talk to the Windows driver about fonts.
PSDVCLIP adds:
rt_Bool *evenOdd; /* winding flags for paths */
PSDVIMGS adds:
ClrPtr color_space; /* image_raw_data : rather than tuck it in gxs */ ImagePtr image_source; /* quick hook to grab the ImageSource */ float alpha; /* also in gxs->fill_alpha */
PSDVIMGRAB adds this for #316:
int is_unbounded_WARNING; /* inline PostScript - can't read to eof */
PSDVGLYPH adds this for #126:
int bytes_per_row; /* pitch / stride */
PSDVCHAREM changes the meaning of these fields for ticket #11:
double x2; /* end point */ /*returned if driver handles glyph!*/ double width; /* character width - *returned if driver handles glyph!* */
PSDVCHAREM adds this for ticket #384:
int text_mode; /* optional: text rendering mode PDFREF 5.2.5 */