|
JPedal Java PDF library 4.70b22 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.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 boolean |
allowChangeCursor
Flag if we should allow cursor to change |
static java.awt.Color |
backgroundColor
The colour of the text once highlighted |
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 color required (used in Storypad grouping) |
int |
displayRotation
used by setPageParameters to draw rotated pages |
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 int |
FINALIMAGES
flag to show extraction mode includes final scaled/clipped |
static JPedalHelper |
Helper
|
static java.awt.Color |
highlightColor
The colour of the highlighting box around the text |
static float |
highlightComposite
The transparency of the highlighting box around the text stored as a float |
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 float |
javaVersion
version number |
boolean |
legacyPrintMode
|
java.awt.Color |
nonDrawnPageColor
|
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 |
ObjectStore |
objectStoreRef
the ObjectStore for this file |
static int |
OCR_PDF
flag to show text highlights need to be done last |
java.awt.Color |
pageColor
page colour for PDF background |
int |
pageNumber
current page |
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 |
REMOVE_RENDERSHAPES
flag to show render mode includes any 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 boolean |
showMouseBox
|
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) |
boolean |
useNewGraphicsMode
|
static java.lang.String |
version
// |
static int |
XFORMMETADATA
flag to show extraction of xforms metadata |
| 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 |
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 |
void |
clearScreen()
remove all displayed objects for JPanel display (wipes current page) |
void |
closePdfFile()
convenience method to close the current PDF file |
void |
decodePage(int rawPage)
decode a page, - page must be between 1 and PdfDecoder.getPageCount() - Will kill off if already running returns minus page if trying to open linearized page not yet available |
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 If you wish to clear all static objects as well, you will also need to call disposeAllStatic() |
static void |
disposeAllStatic()
remove all static elements - only do once completely finished with JPedal as will not be reinitialised |
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 |
ensurePointIsVisible(java.awt.Point p)
make screen scroll to ensure point is visible |
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 |
PdfGroupingAlgorithms |
getBackgroundGroupingObject()
returns object containing grouped text from background grouping - Please see org.jpedal.examples.text for example code |
int |
getCurrentPrintPage()
return page currently being printed or -1 if finished |
java.awt.Rectangle |
getCursorBoxOnScreen()
|
int |
getDisplayView()
returns view mode used - ie SINGLE_PAGE,CONTINUOUS,FACING,CONTINUOUS_FACING (no effect in OS versions) |
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.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 of last decoded page - if no page decoded, a Runtime exception is thrown to warn user 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 |
java.lang.String |
getInfo(int type)
Returns list of the fonts used on the current page decoded or null type can be PdfDictionary.Font or PdfDictionary.Image |
int |
getInsetH()
|
int |
getInsetW()
|
org.jpedal.io.PdfObjectReader |
getIO()
|
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) |
org.w3c.dom.Document |
getMarkedContent()
return markedContent object as XML Document |
java.awt.Dimension |
getMaximumSize()
get sizes of panel This is the PDF pagesize (as set in the PDF from pagesize) - It now includes any scaling factor you have set (ie a PDF size 800 * 600 with a scaling factor of 2 will return 1600 *1200) |
java.awt.Dimension |
getMinimumSize()
get width |
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 |
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()
// |
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 |
org.jpedal.render.DynamicVectorRenderer |
getPageView(java.lang.String currentPageOffset,
int pageNumber)
|
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. |
org.jpedal.objects.PdfData |
getPdfData()
Access should not generally be required to this class. |
int |
getPDFHeight()
get sizes of panel - This is the PDF pagesize |
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 |
int |
getPDFWidth()
get sizes of panel This is the PDF pagesize (as set in the PDF from pagesize) - It now includes any scaling factor you have set |
java.awt.Dimension |
getPreferredSize()
get sizes of panel This is the PDF pagesize (as set in the PDF from pagesize) - It now includes any scaling factor you have set (ie a PDF size 800 * 600 with a scaling factor of 2 will return 1600 *1200) |
java.awt.print.Printable |
getPrintable(int page)
part of pageable interface |
java.lang.String |
getReferenceforPage(int page)
reference for Page object |
float |
getScaling()
|
int |
getScrollInterval()
return amount to scroll window by when scrolling (default is 10) |
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. |
org.jpedal.text.TextLines |
getTextLines()
access textlines object |
java.awt.Point |
getUserOffsets(int mode)
|
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()
|
boolean |
isLoadingLinearizedPDF()
track if file still oaded in background |
boolean |
isOpen()
see if file open - may not be open if user interrupted open or problem encountered |
boolean |
isPageAvailable(int rawPage)
see if page available if in Linearized mode or return true |
boolean |
isPageSuccessful()
shows if page reported any errors while printing. |
boolean |
isPasswordSupplied()
show if encryption password has been supplied or set a certificate |
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 containing 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.security.cert.Certificate certificate,
java.security.PrivateKey key)
allow user to open file using Certificate and key |
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 |
openPdfFileFromInputStream(java.io.InputStream is,
boolean supportLinearized)
routine to open PDF file via InputStream and extract key info from pdf file so we can decode any pages - Does not actually decode the pages themselves - You must explicitly close any open files with closePdfFile() to Java will not release all the memory IMPORTANT NOTE: If the stream does not contain enough bytes, test for Linearization may fail If boolean supportLinearized is true, method will return with true value once Linearized part read (we recommend use you false unless you know exactly what you are doing) |
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() so Java will release all the memory If boolean supportLinearized is true, method will return with true value once Linearized part read |
void |
paint(java.awt.Graphics g)
|
void |
paintComponent(java.awt.Graphics g)
standard method to draw page and any highlights onto JPanel |
boolean |
PDFContainsEmbeddedFonts()
shows if whole document contains embedded fonts and uses them |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int page)
Implements the standard Java printing functionality. |
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,
boolean useSwingThread)
put page onto G2 useSwingThread should be true unless you are using it on a server |
void |
resetCurrentPrintPage()
|
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). |
void |
scrollRectToVisible(java.awt.Rectangle area)
|
void |
setAllowDifferentPrintPageSizes(boolean allowDifferentPrintPageSizes)
allow printing of different sizes pages (default is false as PrintJob does not support different page sizes whereas DocPrintJob does) |
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 |
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. |
void |
setHardwareAccelerationforScreen(boolean useAcceleration)
Enables/Disables hardware acceleration of screen rendering in 1.4 (default is on) |
void |
setInset(int width,
int height)
set an inset display so that display will not touch edge of panel |
void |
setJavaScriptUsed(boolean jsEnabled)
use this to turn javascript on and off, default is on. |
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 |
setPageRotation(int newRotation)
initialise panel and set size to display during updates and update the AffineTransform to new values |
void |
setPDFBorder(javax.swing.border.Border newBorder)
set border for screen and print which will be displayed Setting a new value will enable screen and border painting - disable with disableBorderForPrinting() |
void |
setPDFCursor(java.awt.Cursor c)
Override setCursor so that we can turn on and off |
void |
setPrintAutoRotateAndCenter(boolean value)
set print mode (Matches Abodes Auto Print and rotate output |
void |
setPrintCurrentView(boolean value)
|
void |
setPrintPageMode(int mode)
allow user to select only odd or even pages to print |
void |
setPrintPageScalingMode(int pageScalingMode)
set page scaling mode to use - default setting is PAGE_SCALING_REDUCE_TO_PRINTER_MARGINS All values start PAGE_SCALING |
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 |
setScrollInterval(int scrollInterval)
set amount to scroll window by when scrolling |
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. |
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 |
setUsePDFPaperSize(boolean usePDFPaperSize)
|
void |
setUserOffsets(int x,
int y,
int mode)
allow user to 'move' display of PDF mode is a Constant in org.jpedal.external.OffsetOptions (ie OffsetOptions.SWING_DISPLAY,OffsetOptions.PRINTING) |
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 |
stopPrinting()
ask JPedal to stop printing a page |
void |
unsetScaling()
|
void |
updateCursorBoxOnScreen(java.awt.Rectangle newOutlineRectangle,
java.awt.Color outlineColor)
update rectangle we draw to highlight an area - See SimpleViewer example for example code showing current usage. |
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, 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 final java.lang.String version
public static JPedalHelper Helper
public boolean useNewGraphicsMode
public static boolean showMouseBox
public static java.awt.Color highlightColor
public java.awt.Color pageColor
public java.awt.Color nonDrawnPageColor
public static java.awt.Color backgroundColor
public static float highlightComposite
public int displayRotation
public int pageNumber
public ObjectStore objectStoreRef
public static boolean isRunningOnMac
public static boolean isRunningOnWindows
public static boolean isRunningOnAIX
public static boolean isRunningOnLinux
public static float javaVersion
public static boolean isDraft
public static int dpi
public static boolean embedWidthData
public static boolean allowChangeCursor
public static final boolean inDemo
public boolean legacyPrintMode
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 final int REMOVE_RENDERSHAPES
public static final int OCR_PDF
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 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 getPageFromObjectRef(java.lang.String ref)
ref - - PDF object reference
public boolean isOpen()
public org.w3c.dom.Document getMarkedContent()
public void setPageData(PdfPageData pageData)
pageData - public int getlastPageDecoded()
public org.jpedal.render.DynamicVectorRenderer getPageView(java.lang.String currentPageOffset,
int pageNumber)
public java.util.Iterator getPageInfo(int type)
public org.jpedal.objects.outlines.OutlineData getOutlineData()
public boolean isLoadingLinearizedPDF()
public void resetViewableArea()
public java.awt.geom.AffineTransform setViewableArea(java.awt.Rectangle viewport)
throws PdfException
PdfExceptionpublic int getPageAlignment()
public static void init(boolean newEmbedWidthData)
newEmbedWidthData - -
flag to embed width data in text fragments for use by grouping
algorithmspublic static void disposeAllStatic()
public final void dispose()
public final void closePdfFile()
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 void setPagePrintRange(int start,
int end)
throws PdfException
PdfExceptionpublic void setTextPrint(int textPrint)
public void setJavaScriptUsed(boolean jsEnabled)
public void useLogicalPrintOffset(int pagesPrinted)
public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int page)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablegraphics - the context into which the page is drawnpageFormat - the size and orientation of the page being drawnpage - the zero based index of the page to be drawn
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,
boolean useSwingThread)
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 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 void setPDFCursor(java.awt.Cursor c)
public final void decodePage(int rawPage)
throws java.lang.Exception
java.lang.Exceptionpublic boolean isPageAvailable(int rawPage)
rawPage -
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 final void setEncryptionPassword(java.lang.String password)
throws PdfException
PdfException
public final void openPdfArray(byte[] data)
throws PdfException
PdfException
public void openPdfFile(java.lang.String filename,
java.security.cert.Certificate certificate,
java.security.PrivateKey key)
throws PdfException
filename - certificate - key -
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 final boolean openPdfFileFromURL(java.lang.String pdfUrl,
boolean supportLinearized)
throws PdfException
PdfException
public final boolean openPdfFileFromInputStream(java.io.InputStream is,
boolean supportLinearized)
throws PdfException
PdfExceptionpublic java.lang.Object getJPedalObject(int id)
public void setPageMode(int mode)
public static boolean isXMLExtraction()
public static void useTextExtraction()
public static void useXMLExtraction()
public void clearScreen()
public void setStreamCacheSize(int size)
public boolean hasEmbeddedFonts()
public final boolean PDFContainsEmbeddedFonts()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getInfo(int type)
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 void setDisplayView(int displayView,
int orientation)
public boolean hasJavascript()
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 void unsetScaling()
public java.lang.Object[] getFormDataForField(java.lang.String formName)
public java.util.Set getNamesForAllFields()
throws PdfException
PdfExceptionpublic org.jpedal.io.PdfObjectReader getIO()
public void setPageCount(int numPages)
public java.lang.String getFileName()
public boolean isForm()
public java.lang.String getReferenceforPage(int page)
page -
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 setAllowDifferentPrintPageSizes(boolean allowDifferentPrintPageSizes)
allowDifferentPrintPageSizes - public org.jpedal.text.TextLines getTextLines()
public final void setInset(int width,
int height)
public void ensurePointIsVisible(java.awt.Point p)
public void setUserOffsets(int x,
int y,
int mode)
public java.awt.Point getUserOffsets(int mode)
public final java.awt.Dimension getMaximumSize()
getMaximumSize in class javax.swing.JComponentpublic final java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
public final void updateCursorBoxOnScreen(java.awt.Rectangle newOutlineRectangle,
java.awt.Color outlineColor)
public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentpublic void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic final int getPDFWidth()
public final int getPDFHeight()
public final void setPDFBorder(javax.swing.border.Border newBorder)
public final void setPageRotation(int newRotation)
public void setHardwareAccelerationforScreen(boolean useAcceleration)
public int getScrollInterval()
public void setScrollInterval(int scrollInterval)
public int getDisplayView()
public void setPrintPageScalingMode(int pageScalingMode)
public void setUsePDFPaperSize(boolean usePDFPaperSize)
public float getScaling()
public int getInsetH()
public int getInsetW()
public java.awt.Rectangle getCursorBoxOnScreen()
public void scrollRectToVisible(java.awt.Rectangle area)
scrollRectToVisible in class javax.swing.JComponentpublic 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 void setPageFormat(int p,
java.awt.print.PageFormat pf)
public void setPageFormat(java.awt.print.PageFormat pf)
public void setPagePrintRange(javax.print.attribute.SetOfIntegerSyntax range)
throws PdfException
PdfExceptionpublic void setPrintPageMode(int mode)
public final void stopPrinting()
public int getCurrentPrintPage()
public void resetCurrentPrintPage()
|
JPedal Java PDF library 4.70b22 API Documentation - http://www.jpedal.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||