Package net.atthegate.server.service.pdf
Class PDF
java.lang.Object
net.atthegate.server.service.pdf.PDF
Used to create PDF objects that represent PDF documents.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected Map<String,
Destination> protected static final DecimalFormat
protected List<EmbeddedFile>
protected String
protected List<OptionalContentGroup>
protected int
protected int
protected int
protected Bookmark
-
Constructor Summary
ConstructorsConstructorDescriptionPDF()
The default constructor - use when reading PDF files.PDF
(OutputStream os) Creates a PDF object that represents a PDF document.PDF
(OutputStream os, int compliance) Creates a PDF object that represents a PDF document. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
addMetadataObject
(String notice, boolean fontMetadataObject) void
addObjects
(Map<Integer, PDFobj> objects) int
addOutlineDict
(Bookmark toc) void
addOutlineItem
(int parent, int i, Bookmark bm1) protected int
void
void
addResourceObjects
(Map<Integer, PDFobj> objects) protected void
append
(byte b) protected void
append
(byte[] buf, int off, int len) protected void
append
(char ch) protected void
append
(float val) protected void
append
(int num) protected void
append
(ByteArrayOutputStream baos) protected void
void
close()
Writes the PDF object to the output stream and closes it.protected void
endobj()
void
flush()
Writes the PDF object to the output stream.getPageObjects
(Map<Integer, PDFobj> objects) getPagesObject
(Map<Integer, PDFobj> objects) protected void
newobj()
read
(InputStream inputStream) Returns a list of objects of type PDFobj read from input stream.void
void
Set the "Author" document property of the PDF file.void
setCreator
(String creator) void
setKeywords
(String keywords) void
setPageLayout
(String pageLayout) void
setPageMode
(String pageMode) void
setSubject
(String subject) Set the "Subject" document property of the PDF file.void
Set the "Title" document property of the PDF file.
-
Field Details
-
objNumber
protected int objNumber -
metadataObjNumber
protected int metadataObjNumber -
outputIntentObjNumber
protected int outputIntentObjNumber -
fonts
-
images
-
pages
-
destinations
-
groups
-
states
-
df
-
compliance
protected int compliance -
embeddedFiles
-
toc
-
importedFonts
-
extGState
-
-
Constructor Details
-
PDF
The default constructor - use when reading PDF files.- Throws:
Exception
-
PDF
Creates a PDF object that represents a PDF document.- Parameters:
os
- the associated output stream.- Throws:
Exception
-
PDF
Creates a PDF object that represents a PDF document. Use this constructor to create PDF/A compliant PDF documents. Please note: PDF/A compliance requires all fonts to be embedded in the PDF.- Parameters:
os
- the associated output stream.compliance
- must be: Compliance.PDF_A_1B- Throws:
Exception
-
-
Method Details
-
newobj
- Throws:
IOException
-
endobj
- Throws:
IOException
-
addMetadataObject
- Throws:
Exception
-
addOutputIntentObject
- Throws:
Exception
-
addPage
- Throws:
Exception
-
flush
Writes the PDF object to the output stream. Does not close the underlying output stream.- Throws:
Exception
-
close
Writes the PDF object to the output stream and closes it.- Throws:
Exception
-
setTitle
Set the "Title" document property of the PDF file.- Parameters:
title
- The title of this document.
-
setAuthor
Set the "Author" document property of the PDF file.- Parameters:
author
- The author of this document.
-
setSubject
Set the "Subject" document property of the PDF file.- Parameters:
subject
- The subject of this document.
-
setKeywords
-
setCreator
-
setPageLayout
-
setPageMode
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
append
- Throws:
IOException
-
read
Returns a list of objects of type PDFobj read from input stream.- Parameters:
inputStream
- the PDF input stream.- Returns:
- List
the list of PDF objects. - Throws:
Exception
-
addOutlineDict
- Throws:
Exception
-
addOutlineItem
- Throws:
Exception
-
removePages
- Throws:
Exception
-
addObjects
- Throws:
Exception
-
getPagesObject
- Throws:
Exception
-
getPageObjects
- Throws:
Exception
-
addResourceObjects
- Throws:
Exception
-