Package com._4point.testing.matchers.aem
Class Pdf
java.lang.Object
com._4point.testing.matchers.aem.Pdf
- All Implemented Interfaces:
AutoCloseable
An object representing a PDF that can be queried about its properties.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExceptions specific to PDF Processingstatic classRuntime exceptions specific to PDF Processingstatic classRepresents Usage Rights (granted to this PDF by Reader Extensions or Acrobat) -
Method Summary
Modifier and TypeMethodDescriptionallFonts()Returns a list of the fonts use by the Pdfvoidclose()Returns a list of the fonts embedded in the Pdfstatic Pdffrom(byte[] docBytes) Static factory that creates a Pdf object from a byte array.static Pdffrom(InputStream docStream) Static factory that creates a Pdf object from an InputStream.static PdfStatic factory that creates a Pdf object from a file on the file system.Retrieves the usage rights from the PdfbooleanChecks whether this Pdf has usage rights assigned (via Reader Extensions or Acrobat)booleanhasXfa()Checks whether this Pdf has an XFA sectionbooleanChecks whether this Pdf is a dynamic PdfbooleanChecks whether this Pdf is an interactive PdfbooleanisTagged()Checks whether this Pdf contains Tags
-
Method Details
-
isDynamic
public boolean isDynamic()Checks whether this Pdf is a dynamic Pdf- Returns:
- true if this Pdf is a dynamic Pdf, false if this Pdf is a static Pdf
-
isInteractive
public boolean isInteractive()Checks whether this Pdf is an interactive Pdf- Returns:
- true if this Pdf is an interactive Pdf, false if non-interactive
-
hasXfa
public boolean hasXfa()Checks whether this Pdf has an XFA section- Returns:
- true if this Pdf is an XFA Pdf, otherwise false
-
hasRights
public boolean hasRights()Checks whether this Pdf has usage rights assigned (via Reader Extensions or Acrobat)- Returns:
- true if this Pdf has usage rights assigned.
-
isTagged
public boolean isTagged()Checks whether this Pdf contains Tags- Returns:
- true if Pdf contains tags, otherwise false
-
allFonts
Returns a list of the fonts use by the Pdf- Returns:
- the fonts
- Throws:
Pdf.PdfException- thrown if errors occur when parsing the Pdf
-
embeddedFonts
Returns a list of the fonts embedded in the Pdf- Returns:
- the embedded fonts
- Throws:
Pdf.PdfException- thrown if errors occur when parsing the Pdf
-
getUsageRights
Retrieves the usage rights from the Pdf- Returns:
- the rights
-
from
Static factory that creates a Pdf object from a byte array.- Parameters:
docBytes- bytes containing a complete Pdf document- Returns:
- the Pdf object
- Throws:
Pdf.PdfException- thrown if there are errors parsing the Pdf bytes
-
from
Static factory that creates a Pdf object from an InputStream.- Parameters:
docStream- Pdf byte stream- Returns:
- the Pdf object
- Throws:
Pdf.PdfException- thrown if there are errors reading the Pdf byte stream
-
from
Static factory that creates a Pdf object from a file on the file system.- Parameters:
docPath- location of Pdf file- Returns:
- the Pdf object
- Throws:
Pdf.PdfException- thrown if there are errors reading the Pdf file
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-