PDDocument always creates a real file. Added a constructor option to allow for
the use of a memory buffer rather than a file.
-----------------------------------------------------------------------------------------------------------------------------
Key: PDFBOX-567
URL: https://issues.apache.org/jira/browse/PDFBOX-567
Project: PDFBox
Issue Type: Improvement
Reporter: Yonas Jongkind
Added another constructor that allows for the use of a memory buffer instead.
Better for my usage and less clutter in the temp directory by far.
$ diff -w
'C:/Users/yonasj/AppData/Local/Temp/PDDocument.java-revBASE.svn000.tmp.java'
'C:/dev/pdfbox/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java'
48a49
> import org.apache.pdfbox.io.RandomAccessBuffer;
120a122,134
> this(false);
> }
> /**
> * Constructor, creates a new PDF Document with no pages. You need to add
> * at least one page for the document to be valid.
> * @param memoryScratchFile When true the temp pdf is stored in memory,
> when false as a real file.
> * @throws IOException If there is an error creating this document.
> */
> public PDDocument(boolean memoryScratchFile) throws IOException
> {
> if (memoryScratchFile) {
> document = new COSDocument(new RandomAccessBuffer());
> } else {
121a136
> }
305c320
< PDStream dest = new PDStream( new COSStream( src.getStream(),
document.getScratchFile() ) );
---
> PDStream dest = new PDStream( new COSStream(
> importedPage.getContents().getStream(), document.getScratchFile() ) );
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.