Class RMPDFWriter
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.pdf.writer.PDFFile
com.inductiveautomation.rm.pdf.writer.RMPDFWriter
- All Implemented Interfaces:
- RMPropertyChanger,- Cloneable
PDF Writer.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a writer which holds all bytes in memory via aPDFBuffer.RMPDFWriter(RMDocument document, OutputStream writeTo) Writes the supplied document to the output stream, closing it once complete.
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]getBytes(RMDocument aDoc) Returns a PDF byte array for a given RMDocument.byte[]getBytesPDF(RMDocument aDoc) Deprecated.booleanReturns whether to compress or not.Returns a shared deflater.Returns the current PDF encryptor.booleanReturns whether to include newline and tab characters characters.static booleanReturns whether to include newline and tab characters characters.Returns the current PDF page.Returns default viewer preferences map.voidsetAccessPermissions(String ownerPwd, String userPwd, int accessFlags) Sets pdf user access restrictions.voidsetCompress(boolean aValue) Sets whether to compress or not.voidsetIncludeNewlines(boolean aValue) Sets whether to include newline and tab characters.static voidsetIncludeNewlinesDefault(boolean aValue) Sets whether to include newline and tab characters.voidsetUnmodifiable(String ownerPwd) Set the access permissions on the file such that the document can be opened by anyone, but the user cannot modify the document in any way.static voidSets default viewer preferences map.voidwriteXRefEntry(Object anObj) Writes any kind of object to the PDF buffer.Methods inherited from class com.inductiveautomation.rm.pdf.writer.PDFFileaddImageData, getFileID, getFileIDString, getFontEntry, getFontEntry, getFonts, getImages, getInfoDict, getPagesTree, getUniqueImageData, getVersion, getXRefTable, setAuthor, setCreator, setFontEntry, setVersion, setViewerPreferences, writeXRefTableMethods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toStringMethods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
- 
Constructor Details- 
RMPDFWriterpublic RMPDFWriter()Creates a writer which holds all bytes in memory via aPDFBuffer. Useful for calls togetBytes(RMDocument)If possible, useRMPDFWriter(RMDocument, OutputStream)which will write data directly to the output stream instead of holding it in memory until the very end.
- 
RMPDFWriterWrites the supplied document to the output stream, closing it once complete. NOTE: calls togetBytes(RMDocument)will throw anIllegalStateExceptionas it is expected that the data is written directly to the output stream and not held in memory.- Throws:
- IOException
 
 
- 
- 
Method Details- 
getBytesReturns a PDF byte array for a given RMDocument. Note: this can only be successfully called ifRMPDFWriter()is used to instantiate the writer, which will hold all bytes for the PDF in memory. Instead of calling this function, it is preferable to useRMPDFWriter(RMDocument, OutputStream)which will write directly to the output stream.
- 
getPDFPageReturns the current PDF page.
- 
getPdfOutput
- 
getCompresspublic boolean getCompress()Returns whether to compress or not.
- 
setCompresspublic void setCompress(boolean aValue) Sets whether to compress or not.
- 
getDeflaterReturns a shared deflater.
- 
getEncryptorReturns the current PDF encryptor.
- 
setUnmodifiableSet the access permissions on the file such that the document can be opened by anyone, but the user cannot modify the document in any way. To modify these settings in Acrobat, the owner password would have to be provided.
- 
setAccessPermissionsSets pdf user access restrictions.The user password is the password that will be required to open the file. The owner password is the password that will be required to make future changes to the security settings, such as the passwords. Either of the passwords may be null. If both passwords are null, the file will not be password protected, but it will still be encrypted. Fine-grained access can be limited by setting accessFlags, to limit such things as printing or editing the file. See com.ribs.pdf.PDFSecurityHandler for a list of the access flag constants. (or the pdf spec v1.6, pp. 99-100) 
- 
getViewerPreferencesDefaultReturns default viewer preferences map.
- 
setViewerPreferencesDefaultSets default viewer preferences map.
- 
getIncludeNewlinespublic boolean getIncludeNewlines()Returns whether to include newline and tab characters characters.
- 
setIncludeNewlinespublic void setIncludeNewlines(boolean aValue) Sets whether to include newline and tab characters.
- 
getIncludeNewlinesDefaultpublic static boolean getIncludeNewlinesDefault()Returns whether to include newline and tab characters characters.
- 
setIncludeNewlinesDefaultpublic static void setIncludeNewlinesDefault(boolean aValue) Sets whether to include newline and tab characters.
- 
writeXRefEntryWrites any kind of object to the PDF buffer.
- 
getBytesPDFDeprecated.Obsolete
 
-