Class Configuration
java.lang.Object
org.openpdf.renderer.Configuration
Since there is no context that is passed between the various classes that
perform the pdf parsing and rendering, we introduce this class to at least
globally configure PDFRenderer.
Typically you would configure the global instance before using any other
PDFRenderer API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigurationintReturns the image height threshold at which to enable banded image rendering.booleanIs the color converting op switched on or off?booleanReturnstrueif greyscale images will be converted to ARGBbooleanbooleanbooleanbooleanbooleanbooleanUse blur before image resize to enhance the result (Antialias)?voidsetAvoidColorConvertOp(boolean avoidColorConvertOp) Set this to false to switch off the use of this color convert op which may segfault on some platforms due to a variety of problems related to thread safety and the native cmm library underlying this conversion op, e.g., https://forums.oracle.com/forums/thread.jspa?voidsetConvertGreyscaleImagesToArgb(boolean aFlag) Enables or disables the conversion of greyscale images to ARGB.voidsetPrintFreetextAnnotations(boolean printFreetextAnnotations) Print freetext annotations on pdfvoidsetPrintLinkAnnotations(boolean printLinkAnnotations) Print link annotations on pdfvoidsetPrintSignatureFields(boolean printSignatureFields) Print signature fields on pdfvoidsetPrintStampAnnotations(boolean printStampAnnotations) Print stamp annotations on pdfvoidsetPrintWidgetAnnotations(boolean printWidgetAnnotations) Print widget annotations on pdfvoidsetThresholdForBandedImageRendering(int aSize) If an image is higher than the given size (in pixels) then the image will be rendered in chunks, rather than as one big image.voidsetUseBlurResizingForImages(boolean useBlurResizingForImages) Use blur before image resize to enhance the result (Antialias)
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
getInstance
-
setConvertGreyscaleImagesToArgb
public void setConvertGreyscaleImagesToArgb(boolean aFlag) Enables or disables the conversion of greyscale images to ARGB. Disabling this may have a lower memory overhead with high resolution (e.g. scanned) images. Note that this has to be called beforeis called to have an effect. Enabled by default.invalid reference
#getImage()- Parameters:
aFlag- whether greyscale images shall be converted to ARGB.
-
isConvertGreyscaleImagesToArgb
public boolean isConvertGreyscaleImagesToArgb()Returnstrueif greyscale images will be converted to ARGB -
setThresholdForBandedImageRendering
public void setThresholdForBandedImageRendering(int aSize) If an image is higher than the given size (in pixels) then the image will be rendered in chunks, rather than as one big image. This may lead to lower memory consumption for e.g. scanned PDFs with large images. Set to a value invalid input: '<'= 0 to disable banded image rendering. Defaults to 0 (off)- Parameters:
aSize- the height threshold at which to enable banded image rendering
-
getThresholdForBandedImageRendering
public int getThresholdForBandedImageRendering()Returns the image height threshold at which to enable banded image rendering.- Returns:
- the threshold value, or a value invalid input: '<'= 0 if banded rendering is disabled
-
isAvoidColorConvertOp
public boolean isAvoidColorConvertOp()Is the color converting op switched on or off?- Returns:
- - the usage of this color convert op
-
setAvoidColorConvertOp
public void setAvoidColorConvertOp(boolean avoidColorConvertOp) Set this to false to switch off the use of this color convert op which may segfault on some platforms due to a variety of problems related to thread safety and the native cmm library underlying this conversion op, e.g., https://forums.oracle.com/forums/thread.jspa?threadID=1261882invalid input: '&';tstart=225invalid input: '&messageID'=5356357 (Unix platforms seem the most affected) If the system is bug-free, though, this does make use of native libraries and sees a not insignificant speed-up, though it's still not exactly fast. If we don't run this op now, it's performed at some later stage, but without using the native code- Parameters:
avoidColorConvertOp-
-
isUseBlurResizingForImages
public boolean isUseBlurResizingForImages()Use blur before image resize to enhance the result (Antialias)?- Returns:
- the useBlurResizingForImages
-
setUseBlurResizingForImages
public void setUseBlurResizingForImages(boolean useBlurResizingForImages) Use blur before image resize to enhance the result (Antialias)- Parameters:
useBlurResizingForImages-
-
setPrintSignatureFields
public void setPrintSignatureFields(boolean printSignatureFields) Print signature fields on pdf- Parameters:
printSignatureField-
-
isPrintSignatureFields
public boolean isPrintSignatureFields()- Returns:
trueif signature fields will be printed on pdf
-
setPrintStampAnnotations
public void setPrintStampAnnotations(boolean printStampAnnotations) Print stamp annotations on pdf- Parameters:
printStampAnnotation-
-
isPrintStampAnnotations
public boolean isPrintStampAnnotations()- Returns:
trueif stamp annotations will be printed on pdf
-
setPrintWidgetAnnotations
public void setPrintWidgetAnnotations(boolean printWidgetAnnotations) Print widget annotations on pdf- Parameters:
printWidgetAnnotations-
-
isPrintWidgetAnnotations
public boolean isPrintWidgetAnnotations()- Returns:
trueif widget annotations will be printed on pdf
-
setPrintFreetextAnnotations
public void setPrintFreetextAnnotations(boolean printFreetextAnnotations) Print freetext annotations on pdf- Parameters:
printFreetextAnnotations-
-
isPrintFreetextAnnotations
public boolean isPrintFreetextAnnotations()- Returns:
trueif freetext annotations will be printed on pdf
-
setPrintLinkAnnotations
public void setPrintLinkAnnotations(boolean printLinkAnnotations) Print link annotations on pdf- Parameters:
printLinkAnnotations-
-
isPrintLinkAnnotations
public boolean isPrintLinkAnnotations()- Returns:
trueif link annotations will be printed on pdf
-