|
JPedal Java PDF library 4.10b16 API Documentation - http://www.jpedal.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jpedal.PdfPanel
org.jpedal.PdfDecoder
public class PdfDecoder
Provides an object to decode pdf files and provide a rasterizer if required - Normal usage is to create instance of PdfDecoder and access via public methods. Examples showing usage in org.jpedal.examples - Inherits indirectly from JPanel so can be used as a standard Swing component -
Extends other classes to separate out GUI and business logic but should be regarded as ONE object and PdfPanel should not be instanced - We recommend you access JPedal using only public methods listed in API
| Nested Class Summary | |
|---|---|
class |
PdfDecoder.LinearThread
handles download of rest of file in Linearized mode |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
static int |
BORDER_HIDE
|
static int |
BORDER_SHOW
|
static boolean |
clipOnMac
|
static int |
CLIPPEDIMAGES
flag to show extraction of clipped images at highest res |
static int |
CMYKIMAGES
flag to show extraction of raw cmyk images |
static int |
COLOR
flag to show extraction of colr required (used in Storypad grouping) |
static int |
CURRENT_BORDER_STYLE
|
static org.jpedal.fonts.PdfHeightTable |
currentHeightLookupData
lookup table to precalculated height values |
static boolean |
debugHiRes
|
static boolean |
debugPrint
provide print debug feature - used for internal development only |
static java.lang.String |
defaultFont
font to use in preference to Lucida |
static int |
dpi
dpi for final images |
static boolean |
embedWidthData
flag to tell software to embed x point after each character so we can merge any overlapping text together |
static boolean |
enforceFontSubstitution
flag to show if there must be a mapping value (program exits if none found) |
static int |
FINALIMAGES
flag to show extraction mode includes final scaled/clipped |
static JPedalHelper |
Helper
|
static boolean |
hires
custom hi-res val for JPedal settings |
static boolean |
inDemo
id demo flag disables output in demo |
static boolean |
isDraft
|
static boolean |
isRunningOnAIX
|
static boolean |
isRunningOnLinux
|
static boolean |
isRunningOnMac
flag to show if on mac so we can code around certain bugs |
static boolean |
isRunningOnWindows
|
static boolean |
java3DAvailable
|
static int |
MOUSE_MODE_PANNING
|
static int |
MOUSE_MODE_TEXT_SELECT
|
static int |
NOTEXTPRINT
printing mode using inbuilt java fonts and getting java to rasterize fonts using Java font if match found (added to get around limitations in PCL printing via JPS) - this is the default off setting |
static boolean |
optimiseType3Rendering
|
static int |
RAWCOMMANDS
flag to show extraction mode includes final scaled/clipped |
static int |
RAWIMAGES
flag to show extraction mode includes original images |
static int |
RENDERIMAGES
flag to show render mode includes any images |
static int |
RENDERTEXT
flag to show render mode includes any text |
static boolean |
showErrorMessages
flag to enable popup of error messages in JPedal |
static int |
STANDARDTEXTSTRINGPRINT
printing mode using inbuilt java fonts and getting java to rasterize fonts using Java font if match found (added to get around limitations in PCL printing via JPS) - overrides embedded fonts for standard fonts (ie Arial) |
static int |
SUBSTITUTE_FONT_USING_FAMILY_NAME
|
static int |
SUBSTITUTE_FONT_USING_FILE_NAME
|
static int |
SUBSTITUTE_FONT_USING_FULL_FONT_NAME
|
static int |
SUBSTITUTE_FONT_USING_POSTSCRIPT_NAME
|
static int |
SUBSTITUTE_FONT_USING_POSTSCRIPT_NAME_USE_FAMILY_NAME_IF_DUPLICATES
|
static int |
TEXT
flag to show extraction mode includes any text |
static int |
TEXTCOLOR
flag to show extraction of clipped images at highest res |
static int |
TEXTGLYPHPRINT
printing mode using inbuilt java fonts and getting java to rasterize fonts using Java font if match found (added to get around limitations in PCL printing via JPS) |
static int |
TEXTSTRINGPRINT
printing mode using inbuilt java fonts and getting java to rasterize fonts using Java font if match found (added to get around limitations in PCL printing via JPS) |
static boolean |
usePageFlow3D
|
static java.lang.String |
version
|
static int |
XFORMMETADATA
flag to show extraction of xforms metadata |
| Fields inherited from class org.jpedal.PdfPanel |
|---|
areas, backgroundColor, extractingAsImage, highlightColor, highlightComposite, objectStoreRef, SHOW_BOXES, SHOW_LINES, SHOW_OBJECTS, turnoverOn, useNewGraphicsMode |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.print.Pageable |
|---|
UNKNOWN_NUMBER_OF_PAGES |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PdfDecoder()
Recommend way to create a PdfDecoder for renderer only viewer (not recommended for server extraction only processes) |
|
PdfDecoder(boolean newRender)
Recommend way to create a PdfDecoder if no rendering of page may be required Otherwise use PdfDecoder() |
|
| Method Summary | |
|---|---|
void |
addAdditionalPage(org.jpedal.render.DynamicVectorRenderer dynamicRenderer,
int pageWidth,
int origPageWidth)
used by Storypad to display split spreads not aprt of API |
void |
addExternalHandler(java.lang.Object newHandler,
int type)
allows external helper classes to be added to JPedal to alter default functionality - not part of the API and should be used in conjunction with IDRsolutions only if Options.FormsActionHandler is the type then the newHandler should be of the form org.jpedal.objects.acroforms.ActionHandler |
static void |
addFontFile(java.lang.String currentFont,
java.lang.String fontPath)
method to add a single file to the PDF renderer |
void |
addImage(java.awt.image.BufferedImage img)
used to display non-PDF files |
boolean |
addSubstituteFonts(java.lang.String fontPath,
boolean enforceMapping)
This routine allows the user to add truetype, type1 or type1C fonts which will be used to disalay the fonts in PDF rendering and substitution as if the fonts were embedded in the PDF This is very useful for clients looking to keep down the size of PDFs transmitted and control display quality - Thanks to Peter for the idea/code - How to set it up - JPedal will look for the existence of the directory fontPath (ie com/myCompany/Fonts) - If this exists, Jpedal will look for 3 possible directories (tt,t1c,t1) and make a note of any fonts if these directories exist - When fonts are resolved, this option will be tested first and if a font if found, it will be used to display the font (the effect will be the same as if the font was embedded) - If the enforceMapping is true, JPedal assumes there must be a match and will throw a PdfFontException - Otherwise Jpedal will look in the java font path for a match or approximate with Lucida - The Format is defined as follows: - fontname = filename Type1/Type1C Font names exclude any prefix so /OEGPNB+FGHeavyItalic is resolved to FGHeavyItalic - Each font have the same name as the font it replaces (so Arial will require a font file such as Arial.ttf) and it must be unique (there cannot be an Arial font in each sub-directory) - So to use this functionality, place the fonts in a jar or add to the JPedal jar and call this method after instancing PdfDecoder - JPedal will do the rest |
void |
clearScreen()
remove all displayed objects for JPanel display (wipes current page) |
void |
closePdfFile()
convenience method to close the current PDF file |
void |
decodeOtherPages(int pageCount)
used to decode multiple pages on views |
void |
decodePage(int rawPage)
decode a page, - page must be between 1 and PdfDecoder.getPageCount() - Will kill off if already running |
void |
decodePageForMarkedContent(int pageNumber,
org.jpedal.objects.raw.PdfObject pdfObject,
java.lang.Object pageStream)
extract marked content - not yet live |
void |
decodePageInBackground(int i)
decode a page as a background thread (use other background methods to access data) we now recommend you use decodePage as this has been heavily optimised for speed |
void |
dispose()
convenience method to remove all items from memory |
void |
drawAdditionalObjectsOverPage(int page,
int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
allow user to add grapical content on top of page - for display ONLY Additional calls will overwrite current settings on page ONLY works in SINGLE VIEW displaymode |
void |
flushAdditionalObjectsOnPage(int page)
allow user to remove all additional grapical content from the page (only for display) ONLY works in SINGLE VIEW displaymode |
void |
flushObjectValues(boolean reinit)
provide method for outside class to clear store of objects once written out to reclaim memory |
int |
getAdditionalPageCount()
|
PdfGroupingAlgorithms |
getBackgroundGroupingObject()
returns object containing grouped text from background grouping - Please see org.jpedal.examples.text for example code |
static int |
getBorderStyle()
|
int |
getCurrentPrintPage()
return page currently being printed or -1 if finished |
DPIFactory |
getDPIFactory()
return handle on PDFFactory which adjusts display size so matches size in Acrobat |
org.jpedal.render.DynamicVectorRenderer |
getDynamicRenderer()
gets DynamicVector Object |
org.jpedal.render.DynamicVectorRenderer |
getDynamicRenderer(boolean reset)
gets DynamicVector Object - NOT PART OF API and subject to change (DO NOT USE) |
java.lang.Object |
getExternalHandler(int type)
allows external helper classes to be accessed if needed - also allows user to access SwingGUI if running full Viewer package - not all Options available to get - please contact IDRsolutions if you are looking to use |
PdfFileInformation |
getFileInformationData()
method to return null or object giving access info fields and metadata. |
java.lang.String |
getFileName()
|
java.lang.String |
getFontsInFile()
Returns list of the fonts used on the current page decoded |
static int |
getFontSubstitutionMode()
set mode to use when substituting fonts (default is to use Filename (ie arial.ttf) Options are SUBSTITUTE_* values from PdfDecoder |
java.lang.Object |
getFormDataForField(java.lang.String formName)
return PDF data object or Objects for field containing values from PDF file This will take either the Name or the PDFref (ie Box or 12 0 R) This can return an object[] if Box is a radio button with multiple vales so you need to check instanceof Object[] on data In the case of a PDF with radio buttons Box (12 0 R), Box (13 0 R), Box (14 0 R) getFormDataAsObject(Box) would return an Object which is actually Object[3] getFormDataAsObject(12 0 R) would return an Object which is a single value |
org.jpedal.objects.acroforms.rendering.AcroRenderer |
getFormRenderer()
Allow user to access Forms renderer - returns null not available (should not generally be needed) |
PdfGroupingAlgorithms |
getGroupingObject()
returns object containing grouped text - Please see org.jpedal.examples.text for example code. |
float |
getHiResUpscaleFactor()
return scaleup factor applied to last Hires image of page generated negative values mean no upscaling applied and should be ignored |
org.jpedal.io.PdfObjectReader |
getIO()
return swing widget regardless of whether it came from Annot or form |
java.util.Map |
getJPedalActionHandlers()
|
java.lang.Object |
getJPedalObject(int id)
will return some dictionary values - if not a set value, will return null |
int |
getlastPageDecoded()
return page number for last page decoded (only use in SingleDisplay mode) |
PdfLayerList |
getLayers()
Deprecated. - please use (PdfLayerList)getJPedalObject(PdfDictionary.Layer); |
org.w3c.dom.Document |
getMarkedContent()
return markedContent object as XML Document |
int |
getMouseMode()
|
java.util.Set |
getNamesForAllFields()
return full list of Fields for Annots and Forms |
int |
getNumberOfPages()
part of pageable interface - used only in printing Use getPageCount() for number of pages |
ObjectStore |
getObjectStore()
return object which provides access to file images and name |
int |
getObjectUnderneath(int x,
int y)
|
org.w3c.dom.Document |
getOutlineAsXML()
return a DOM document containing the PDF Outline object as a DOM Document - may return null |
org.jpedal.objects.outlines.OutlineData |
getOutlineData()
provide direct access to outlineData object |
int |
getPageAlignment()
return type of alignment for pages if smaller than panel - see options in Display class. |
java.awt.image.BufferedImage |
getPageAsHiRes(int pageIndex)
|
java.awt.image.BufferedImage |
getPageAsHiRes(int pageIndex,
boolean isTransparent)
|
java.awt.image.BufferedImage |
getPageAsHiRes(int pageIndex,
java.util.Map params)
|
java.awt.image.BufferedImage |
getPageAsHiRes(int pageIndex,
java.util.Map params,
boolean isTransparent)
|
java.awt.image.BufferedImage |
getPageAsImage(int pageIndex)
generate BufferedImage of a page in current file Page size is defined by CropBox |
java.awt.image.BufferedImage |
getPageAsTransparentImage(int pageIndex)
generate BufferedImage of a page in current file |
int |
getPageCount()
get page count of current PDF file |
java.lang.String |
getPageDecodeReport()
return any errors or other messages while calling decodePage() - zero length is no problems |
boolean |
getPageDecodeStatus(int status)
|
java.lang.String |
getPageDecodeStatusReport(int status)
get page statuses |
java.lang.String |
getPageFailureMessage()
Return String with all error messages from last printed (useful for debugging) |
java.awt.print.PageFormat |
getPageFormat(int p)
part of pageable interface |
int |
getPageFromObjectRef(java.lang.String ref)
given a ref, what is the page |
java.util.Iterator |
getPageInfo(int type)
return details on page for type (defined in org.jpedal.constants.PageInfo) or null if no values Unrecognised key will throw a RunTime exception null returned if JPedal not clear on result |
java.awt.Point |
getPageOffsets(int page)
|
org.jpedal.objects.PdfData |
getPdfBackgroundData()
Access should not generally be required to this class. |
PdfImageData |
getPdfBackgroundImageData()
provide method for outside class to get data object containing images. |
byte[] |
getPdfBuffer()
convenience method to get the PDF data as a byte array - works however file was opened. |
org.jpedal.objects.PdfData |
getPdfData()
Access should not generally be required to this class. |
int |
getPDFflag(java.lang.Integer i)
give user access to PDF flag value - if file not open or input not valid returns -1 Possible values in PdfFLAGS ie PDFflags.USER_ACCESS_PERMISSIONS - return P value PDFflags.VALID_PASSWORD_SUPPLIED - tell if password supplied and if owner or user POssible values PDFflags.NO_VALID_PASSWORD, PDFflags.VALID_USER_PASSWORD, PDFflags.VALID_OWNER_PASSWORD or both USER and owner |
PdfImageData |
getPdfImageData()
provide method for outside class to get data object containing images |
PdfPageData |
getPdfPageData()
Provides method for outside class to get data object containing information on the page for calculating grouping Please note: Structure of PdfPageData is not guaranteed to remain constant. |
java.lang.String |
getPDFVersion()
get PDF version in file |
java.awt.print.Printable |
getPrintable(int page)
part of pageable interface |
java.awt.image.BufferedImage |
getSelectedRectangleOnscreen(float t_x1,
float t_y1,
float t_x2,
float t_y2,
float scaling)
If running in GUI mode, will extract a section of rendered page as BufferedImage -coordinates are PDF co-ordinates. |
int |
getXCordForPage(int page,
float scaling)
used internally by multiple pages scaling -1 to ignore, -2 to force reset |
int |
getXDisplacement()
|
int |
getYCordForPage(int page,
float scaling)
used internally by multiple pages scaling -1 to ignore, -2 to force reset |
boolean |
hasAllImages()
flag to show if we suspect problem with some images |
boolean |
hasEmbeddedFonts()
shows if embedded fonts present on page just decoded |
boolean |
hasJavascript()
show if page is an XFA form |
boolean |
hasOutline()
flag to show if PDF document contains an outline |
static void |
init(boolean newEmbedWidthData)
This will be needed for text extraction as it paramter makes sure widths included in text stream |
boolean |
isEncrypted()
return true if the current pdf file is encrypted check isFileViewable(), if file is encrypted and not viewable - a user specified password is needed. |
boolean |
isExtractionAllowed()
show if content can be extracted |
boolean |
isFileViewable()
show if encrypted file can be viewed, if false a password needs entering |
boolean |
isForm()
|
static boolean |
isHires()
|
boolean |
isLoadingLinearizedPDF()
track if file still oaded in background |
boolean |
isMultiPageTiff()
|
boolean |
isOpen()
see if file open - may not be open if user interrupted open or problem encountered |
boolean |
isPageSuccessful()
shows if page reported any errors while printing or being decoded. |
boolean |
isPasswordSupplied()
show if encryption password has been supplied |
boolean |
isPDF()
|
boolean |
isPDFLinearized(java.lang.String pdfUrl)
examine first few bytes to see if linearized and return true linearized file |
boolean |
isThumbnailsDrawing()
|
static boolean |
isXMLExtraction()
shows if text extraction is XML or pure text |
static void |
modifyJPedalParameters(java.util.Map values)
allow user to alter certain values in software such as Colour, If you are using decoder.getPageAsHiRes() after passing additional parameters into JPedal using the static method PdfDecoder.modifyJPedalParameters(), then getPageAsHiRes() wont necessarily be thread safe. |
void |
modifyNonstaticJPedalParameters(java.util.Map values)
allow user to alter certain values in software such as Colour, Please note all Color and text highlighting values are static and common across the JVM |
void |
openPdfArray(byte[] data)
routine to open a byte stream cntaining the PDF file and extract key info from pdf file so we can decode any pages. |
void |
openPdfFile(java.lang.String filename)
routine to open PDF file and extract key info from pdf file so we can decode any pages. |
void |
openPdfFile(java.lang.String filename,
java.lang.String password)
routine to open PDF file and extract key info from pdf file so we can decode any pages which also sets password. |
boolean |
openPdfFileFromURL(java.lang.String pdfUrl,
boolean supportLinearized)
routine to open PDF file via URL and extract key info from pdf file so we can decode any pages - Does not actually decode the pages themselves - Also reads the form data - Based on an idea by Peter Jacobsen You must explicitly close any open files with closePdfFile() to Java will not release all the memory If boolean supportLinearized is true, method will return with true value once Linearized part read |
boolean |
PDFContainsEmbeddedFonts()
shows if whole document contains embedded fonts and uses them |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pf,
int page)
implements the standard Java printing functionality if start |
void |
printAdditionalObjectsOverAllPages(int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
store objects to use on a print |
void |
printAdditionalObjectsOverPage(int page,
int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
store objects to use on a print |
void |
renderPageOntoGraphics2D(float scaling,
int pageIndex,
java.awt.Graphics2D g2)
put page onto G2 |
void |
resetCurrentPrintPage()
|
void |
resetFormsForPageFlow(int page)
handle forms drawing as not take care of in decodePage as in other modes |
void |
resetForNonPDFPage()
used for non-PDF files to reset page |
void |
resetViewableArea()
turns off the viewable area, scaling the page back to original scaling NOT RECOMMENDED FOR GENERAL USE (this has been added for a specific client and we have found it can be unpredictable on some PDF files). |
static void |
setBorderStyle(int style)
|
void |
setCenterOnScaling(boolean center)
|
static void |
setDebugPrint(boolean newDebugPrint)
provides details on printing to enable debugging info for IDRsolutions |
static void |
setDefaultDisplayFont(java.lang.String fontName)
set the font used for default from Java fonts on system - Java fonts are case sensitive, but JPedal resolves this internally, so you could use Webdings, webdings or webDings for Java font Webdings - checks if it is a valid Java font (otherwise it will default to Lucida anyway) |
void |
setDisplayView(int displayView,
int orientation)
set view mode used in panel and redraw in new mode SINGLE_PAGE,CONTINUOUS,FACING,CONTINUOUS_FACING delay is the time in milli-seconds which scrolling can stop before background page drawing starts Multipage views not in OS releases |
void |
setDownloadWindomPosition(int x,
int y)
|
void |
setEncryptionPassword(java.lang.String password)
set a password for encryption - software will resolve if user or owner password- calls verifyAccess() from 2.74 so no separate call needed |
void |
setExtractionMode(int mode)
set extraction mode telling JPedal what to extract - (TEXT,RAWIMAGES,FINALIMAGES - add together to combine) - See org.jpedal.examples for specific extraction examples |
void |
setExtractionMode(int mode,
int imageDpi,
float scaling)
Please do not use for general usage. |
static java.lang.String |
setFontDirs(java.lang.String[] fontDirs)
takes a String[] of font directories and adds to substitution - Can just be called for each JVM - Should be called before file opened - this offers an alternative to the call -DFontDirs - Passing a null value flushes all settings |
static void |
setFontReplacements(PdfDecoder decode_pdf)
set up our font replacement values |
static void |
setFontSubstitutionMode(int mode)
set mode to use when substituting fonts (default is to use Filename (ie arial.ttf) Options are SUBSTITUTE_* values from PdfDecoder |
void |
setlastPageDecoded(int page)
set page number for last page decoded (only use in SingleDisplay mode) Only used when file is not PDf but has multiple pages (i.e multipaged tiff) |
void |
setMouseMode(int mouseMode)
|
void |
setMultiPageTiff(boolean isMultiPageTiff)
|
void |
setObjectStore(ObjectStore newStore)
return object which provides access to file images and name (use not recommended) |
void |
setPageCount(int numPages)
|
void |
setPageData(PdfPageData pageData)
used by remote printing to pass in page metrics |
void |
setPageDecodeStatus(int status,
java.lang.Object value)
allow user to set certain paramters - only supports DecodeStatus.Timeout at present |
void |
setPageFormat(int p,
java.awt.print.PageFormat pf)
set pageformat for a specific page - if no pageFormat is set a default will be used. |
void |
setPageFormat(java.awt.print.PageFormat pf)
set pageformat for a specific page - if no pageFormat is set a default will be used. |
void |
setPageMode(int mode)
|
void |
setPageParameters(float scaling,
int pageNumber)
initialise panel and set size to fit PDF page intializes display with rotation set to the default, specified in the PDF document scaling value of -1 means keep existing setting |
void |
setPageParameters(float scaling,
int pageNumber,
int newRotation)
calls setPageParameters(scaling,pageNumber) after setting rotation to draw page |
void |
setPagePrintRange(int start,
int end)
set page range (inclusive) - If end is less than start it will print them backwards (invalid range will throw PdfException) |
void |
setPagePrintRange(javax.print.attribute.SetOfIntegerSyntax range)
set inclusive range to print (see SilentPrint.java and SimpleViewer.java for sample print code (invalid range will throw PdfException) can take values such as new PageRanges("3,5,7-9,15"); |
void |
setPDF(boolean isPDf)
|
void |
setPrintAutoRotateAndCenter(boolean value)
set print mode (Matches Abodes Auto Print and rotate output |
void |
setPrintCurrentView(boolean value)
|
void |
setPrintIndent(int oddPages,
int evenPages)
set a left margin for printing pages (ie for duplex) (ent only) |
void |
setPrintPageMode(int mode)
allow user to select only odd or even pages to print |
void |
setRenderMode(int mode)
set render mode to state what is displayed onscreen (ie RENDERTEXT,RENDERIMAGES) - only generally required if you do not wish to show all objects on screen (default is all). |
void |
setStatusBarObject(StatusBar statusBar)
set status bar to use when decoding a page - StatusBar provides a GUI object to display progress and messages. |
void |
setStreamCacheSize(int size)
allows user to cache large objects to disk to avoid memory issues, setting minimum size in bytes (of uncompressed stream) above which object will be stored on disk if possible (default is -1 bytes which is all objects stored in memory) - Must be set before file opened. |
static void |
setSubstitutedFontAliases(java.lang.String fontFileName,
java.lang.String[] aliases)
allows a number of fonts to be mapped onto an actual font and provides a way around slightly differing font naming when substituting fonts - So if arialMT existed on the target machine and the PDF contained arial and helvetica (which you wished to replace with arialmt), you would use the following code - String[] aliases={"arial","helvetica"}; currentPdfDecoder.setSubstitutedFontAliases("arialmt",aliases); - comparison is case-insensitive and file type/ending should not be included - For use in conjunction with -Dorg.jpedal.fontdirs options which allows user to pass a set of comma separated directories with Truetype fonts (directories do not need to exist so can be multi-platform setting) |
void |
setTextPrint(int textPrint)
tells program to try and use Java's font printing if possible as work around for issue with PCL printing - values are PdfDecoder.TEXTGLYPHPRINT (use Java to rasterize font if available) PdfDecoder.TEXTSTRINGPRINT( print as text not raster - fastest option) PdfDecoder.NOTEXTPRINT (default - highest quality) |
void |
setThumbnailsDrawing(boolean b)
initialise display hotspots and save global values public void createPageHostspots(String[] annotationTypes, String string) { if(showAnnotations) return; if(displayHotspots==null || specialMode==SpecialOptions.NONE || specialMode==SpecialOptions.SINGLE_PAGE) displayHotspots = new Hotspots(annotationTypes, string); printHotspots = new Hotspots(annotationTypes, string); }/ |
void |
setupPage(org.jpedal.parser.PdfStreamDecoder current,
boolean alwaysCheck)
initialise OC Content and other items before Page decoded but after Resources read |
java.awt.geom.AffineTransform |
setViewableArea(java.awt.Rectangle viewport)
allows the user to create a viewport within the displayed page, the aspect ratio is keep for the PDF page Passing in a null value is the same as calling resetViewableArea() The viewport works from the bottom left of the PDF page The general formula is (leftMargin, bottomMargin, pdfWidth-leftMargin-rightMargin, pdfHeight-bottomMargin-topMargin) NOT RECOMMENDED FOR GENERAL USE (this has been added for a specific client and we have found it can be unpredictable on some PDF files). |
void |
showImageableArea()
show the imageable area in printout for debugging purposes |
void |
stopPrinting()
ask JPedal to stop printing a page |
void |
unsetScaling()
|
void |
updatePageNumberDisplayed(int page)
used by Javascript to update page number |
void |
useHiResScreenDisplay(boolean value)
uses hires images to create a higher quality display - downside is it is slower and uses more memory (default is false).- Does nothing in OS version |
void |
useLogicalPrintOffset(int pagesPrinted)
If you are printing PDFs using JPedal in your custom code, you may find pages missing, because JPedal does not know about these additional pages. |
static void |
useTextExtraction()
XML extraction is the default - pure text extraction is much faster |
static void |
useXMLExtraction()
XML extraction is the default - pure text extraction is much faster |
void |
waitForDecodingToFinish()
wait for decoding to finish |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean java3DAvailable
public static boolean usePageFlow3D
public static final java.lang.String version
public static boolean debugHiRes
public static final boolean optimiseType3Rendering
public static JPedalHelper Helper
public static final int MOUSE_MODE_TEXT_SELECT
public static final int MOUSE_MODE_PANNING
public static org.jpedal.fonts.PdfHeightTable currentHeightLookupData
public static boolean isRunningOnMac
public static boolean isRunningOnWindows
public static boolean isRunningOnAIX
public static boolean isRunningOnLinux
public static boolean clipOnMac
public static boolean debugPrint
public static boolean isDraft
public static int dpi
public static boolean embedWidthData
public static final boolean inDemo
public static boolean hires
public static final int TEXT
public static final int RAWIMAGES
public static final int FINALIMAGES
public static final int RAWCOMMANDS
public static final int CLIPPEDIMAGES
public static final int TEXTCOLOR
public static final int CMYKIMAGES
public static final int XFORMMETADATA
public static final int COLOR
public static final int RENDERTEXT
public static final int RENDERIMAGES
public static boolean enforceFontSubstitution
public static java.lang.String defaultFont
public static final int NOTEXTPRINT
public static final int TEXTGLYPHPRINT
public static final int TEXTSTRINGPRINT
public static final int STANDARDTEXTSTRINGPRINT
public static final int SUBSTITUTE_FONT_USING_FILE_NAME
public static final int SUBSTITUTE_FONT_USING_POSTSCRIPT_NAME
public static final int SUBSTITUTE_FONT_USING_FAMILY_NAME
public static final int SUBSTITUTE_FONT_USING_FULL_FONT_NAME
public static final int SUBSTITUTE_FONT_USING_POSTSCRIPT_NAME_USE_FAMILY_NAME_IF_DUPLICATES
public static final int BORDER_SHOW
public static final int BORDER_HIDE
public static int CURRENT_BORDER_STYLE
public static boolean showErrorMessages
| Constructor Detail |
|---|
public PdfDecoder(boolean newRender)
newRender - flag to show if pages being rendered for JPanel or extractionpublic PdfDecoder()
| Method Detail |
|---|
public int getMouseMode()
public void setMouseMode(int mouseMode)
public int getPageFromObjectRef(java.lang.String ref)
ref - - PDF object reference
public static void setBorderStyle(int style)
public static int getBorderStyle()
public void setPrintIndent(int oddPages,
int evenPages)
oddPages - public boolean isOpen()
public org.w3c.dom.Document getMarkedContent()
public void setPageData(PdfPageData pageData)
pageData -
public void addAdditionalPage(org.jpedal.render.DynamicVectorRenderer dynamicRenderer,
int pageWidth,
int origPageWidth)
public int getXDisplacement()
public int getAdditionalPageCount()
public void updatePageNumberDisplayed(int page)
public int getlastPageDecoded()
public void setlastPageDecoded(int page)
public void setupPage(org.jpedal.parser.PdfStreamDecoder current,
boolean alwaysCheck)
current - public static boolean isHires()
public java.util.Iterator getPageInfo(int type)
public void resetFormsForPageFlow(int page)
public org.jpedal.objects.outlines.OutlineData getOutlineData()
public boolean isLoadingLinearizedPDF()
public static void setSubstitutedFontAliases(java.lang.String fontFileName,
java.lang.String[] aliases)
public void resetViewableArea()
public java.awt.geom.AffineTransform setViewableArea(java.awt.Rectangle viewport)
throws PdfException
PdfExceptionpublic static java.lang.String setFontDirs(java.lang.String[] fontDirs)
public static void setFontSubstitutionMode(int mode)
public static int getFontSubstitutionMode()
public static void addFontFile(java.lang.String currentFont,
java.lang.String fontPath)
currentFont - - actual font name we use to identifyfontPath - - full path to font file used for this fontpublic int getPageAlignment()
public static void init(boolean newEmbedWidthData)
newEmbedWidthData - -
flag to embed width data in text fragments for use by grouping
algorithmspublic final void dispose()
public final void closePdfFile()
public final byte[] getPdfBuffer()
public final org.jpedal.objects.PdfData getPdfBackgroundData()
public final org.jpedal.objects.PdfData getPdfData()
throws PdfException
PdfExceptionpublic final boolean hasOutline()
public final org.w3c.dom.Document getOutlineAsXML()
public final PdfPageData getPdfPageData()
public java.awt.Point getPageOffsets(int page)
public void setPagePrintRange(int start,
int end)
throws PdfException
PdfExceptionpublic void setPrintPageMode(int mode)
public void setPagePrintRange(javax.print.attribute.SetOfIntegerSyntax range)
throws PdfException
PdfExceptionpublic void setTextPrint(int textPrint)
public void setCenterOnScaling(boolean center)
public void useLogicalPrintOffset(int pagesPrinted)
public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pf,
int page)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablegraphics - -
object page rendered ontopf - PageFormat object used to printpage - -
current page index (less 1 so start at page 0)
java.awt.print.PrinterException
public java.awt.image.BufferedImage getPageAsHiRes(int pageIndex)
throws PdfException
pageIndex - number of the page we want to extract
PdfException - Page size is defined by CropBox
see http://www.jpedal.org/gplSrc/org/jpedal/examples/images/HiResThumbnailExtractor.java.html for full details
public java.awt.image.BufferedImage getPageAsHiRes(int pageIndex,
java.util.Map params)
throws PdfException
pageIndex - number of the page we want to extractparams - list of values to override static settings in modifyJPedalParameters for this instance only
PdfException - Page size is defined by CropBox
see http://www.jpedal.org/gplSrc/org/jpedal/examples/images/HiResThumbnailExtractor.java.html for full details
public java.awt.image.BufferedImage getPageAsHiRes(int pageIndex,
java.util.Map params,
boolean isTransparent)
throws PdfException
pageIndex - number of the page we want to extractparams - list of values to override static settings in modifyJPedalParameters for this instance onlyisTransparent - - set if transparent or has background
PdfException - Page size is defined by CropBox
see http://www.jpedal.org/gplSrc/org/jpedal/examples/images/HiResThumbnailExtractor.java.html for full details
public java.awt.image.BufferedImage getPageAsHiRes(int pageIndex,
boolean isTransparent)
throws PdfException
pageIndex - number of the page we want to extract
PdfException - Page size is defined by CropBox
see http://www.jpedal.org/gplSrc/org/jpedal/examples/images/HiResThumbnailExtractor.java.html for full details
public java.awt.image.BufferedImage getPageAsImage(int pageIndex)
throws PdfException
PdfException
public java.awt.image.BufferedImage getPageAsTransparentImage(int pageIndex)
throws PdfException
PdfException
public void renderPageOntoGraphics2D(float scaling,
int pageIndex,
java.awt.Graphics2D g2)
throws java.lang.Exception
java.lang.Exceptionpublic float getHiResUpscaleFactor()
public final void flushObjectValues(boolean reinit)
reinit - lag to show if image data flushed as wellpublic final PdfImageData getPdfImageData()
public final PdfImageData getPdfBackgroundImageData()
public final void setRenderMode(int mode)
public final void setExtractionMode(int mode)
public void modifyNonstaticJPedalParameters(java.util.Map values)
throws PdfException
PdfException
public static void modifyJPedalParameters(java.util.Map values)
throws PdfException
PdfExceptionpublic final PdfFileInformation getFileInformationData()
public final void setExtractionMode(int mode,
int imageDpi,
float scaling)
public DPIFactory getDPIFactory()
public final void setPageParameters(float scaling,
int pageNumber)
public final void setPageParameters(float scaling,
int pageNumber,
int newRotation)
public void setStatusBarObject(StatusBar statusBar)
public void waitForDecodingToFinish()
public final void stopPrinting()
public org.jpedal.render.DynamicVectorRenderer getDynamicRenderer()
public org.jpedal.render.DynamicVectorRenderer getDynamicRenderer(boolean reset)
public final void decodePageForMarkedContent(int pageNumber,
org.jpedal.objects.raw.PdfObject pdfObject,
java.lang.Object pageStream)
throws java.lang.Exception
java.lang.Exceptionpublic final void decodeOtherPages(int pageCount)
public final void decodePage(int rawPage)
throws java.lang.Exception
java.lang.Exception
public void printAdditionalObjectsOverPage(int page,
int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
throws PdfException
page - type - colors - obj -
PdfException
public void printAdditionalObjectsOverAllPages(int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
throws PdfException
type - colors - obj -
PdfException
public void drawAdditionalObjectsOverPage(int page,
int[] type,
java.awt.Color[] colors,
java.lang.Object[] obj)
throws PdfException
PdfException
public void flushAdditionalObjectsOnPage(int page)
throws PdfException
PdfExceptionpublic void useHiResScreenDisplay(boolean value)
value -
public final void decodePageInBackground(int i)
throws java.lang.Exception
java.lang.Exceptionpublic final int getPageCount()
public final boolean isEncrypted()
public final boolean isPasswordSupplied()
public boolean isFileViewable()
public boolean isExtractionAllowed()
public int getPDFflag(java.lang.Integer i)
public static void setDefaultDisplayFont(java.lang.String fontName)
throws PdfFontException
PdfFontException
public final void setEncryptionPassword(java.lang.String password)
throws PdfException
PdfException
public final void openPdfArray(byte[] data)
throws PdfException
PdfException
public final void openPdfFile(java.lang.String filename)
throws PdfException
PdfException
public final void openPdfFile(java.lang.String filename,
java.lang.String password)
throws PdfException
PdfException
public void setDownloadWindomPosition(int x,
int y)
public final boolean openPdfFileFromURL(java.lang.String pdfUrl,
boolean supportLinearized)
throws PdfException
PdfException
public final boolean isPDFLinearized(java.lang.String pdfUrl)
throws PdfException
pdfUrl -
PdfExceptionpublic PdfLayerList getLayers()
public java.lang.Object getJPedalObject(int id)
public void setPageMode(int mode)
public boolean addSubstituteFonts(java.lang.String fontPath,
boolean enforceMapping)
fontPath - -
root directory for fontsenforceMapping - -
tell JPedal if all fonts should be in this directory
public void setThumbnailsDrawing(boolean b)
public void showImageableArea()
public int getNumberOfPages()
getNumberOfPages in interface java.awt.print.PageablePageable.getNumberOfPages()
public java.awt.print.PageFormat getPageFormat(int p)
throws java.lang.IndexOutOfBoundsException
getPageFormat in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsExceptionPageable.getPageFormat(int)
public java.awt.print.Printable getPrintable(int page)
throws java.lang.IndexOutOfBoundsException
getPrintable in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsExceptionPageable.getPrintable(int)
public void setPageFormat(int p,
java.awt.print.PageFormat pf)
public void setPageFormat(java.awt.print.PageFormat pf)
public static boolean isXMLExtraction()
public static void useTextExtraction()
public static void useXMLExtraction()
public void clearScreen()
public void setStreamCacheSize(int size)
public void addImage(java.awt.image.BufferedImage img)
public boolean hasEmbeddedFonts()
public final boolean PDFContainsEmbeddedFonts()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getFontsInFile()
public org.jpedal.objects.acroforms.rendering.AcroRenderer getFormRenderer()
public boolean isPageSuccessful()
public java.lang.String getPageDecodeReport()
public java.lang.String getPageFailureMessage()
public java.awt.image.BufferedImage getSelectedRectangleOnscreen(float t_x1,
float t_y1,
float t_x2,
float t_y2,
float scaling)
t_x1 - t_y1 - t_x2 - t_y2 - scaling -
public ObjectStore getObjectStore()
public void setObjectStore(ObjectStore newStore)
public PdfGroupingAlgorithms getGroupingObject()
throws PdfException
PdfExceptionpublic PdfGroupingAlgorithms getBackgroundGroupingObject()
public final java.lang.String getPDFVersion()
public void resetForNonPDFPage()
public static void setDebugPrint(boolean newDebugPrint)
public void setDisplayView(int displayView,
int orientation)
public boolean hasJavascript()
public int getCurrentPrintPage()
public void resetCurrentPrintPage()
public boolean hasAllImages()
public void setPageDecodeStatus(int status,
java.lang.Object value)
status - value - public boolean getPageDecodeStatus(int status)
public java.lang.String getPageDecodeStatusReport(int status)
public void setPrintAutoRotateAndCenter(boolean value)
public void setPrintCurrentView(boolean value)
public void addExternalHandler(java.lang.Object newHandler,
int type)
newHandler - type - public java.lang.Object getExternalHandler(int type)
type -
public int getYCordForPage(int page,
float scaling)
public void unsetScaling()
public int getXCordForPage(int page,
float scaling)
public java.lang.Object getFormDataForField(java.lang.String formName)
public java.util.Set getNamesForAllFields()
throws PdfException
PdfExceptionpublic org.jpedal.io.PdfObjectReader getIO()
public boolean isThumbnailsDrawing()
public void setPageCount(int numPages)
public boolean isPDF()
public void setPDF(boolean isPDf)
public boolean isMultiPageTiff()
public void setMultiPageTiff(boolean isMultiPageTiff)
public java.lang.String getFileName()
public int getObjectUnderneath(int x,
int y)
public static void setFontReplacements(PdfDecoder decode_pdf)
decode_pdf - public java.util.Map getJPedalActionHandlers()
public boolean isForm()
|
JPedal Java PDF library 4.10b16 API Documentation - http://www.jpedal.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||