[ https://issues.apache.org/jira/browse/PDFBOX-567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Hewson updated PDFBOX-567: ------------------------------- Summary: PDDocument always creates a real file (was: PDDocument always creates a real file. Added a constructor option to allow for the use of a memory buffer rather than a file.) > PDDocument always creates a real file > ------------------------------------- > > Key: PDFBOX-567 > URL: https://issues.apache.org/jira/browse/PDFBOX-567 > Project: PDFBox > Issue Type: Improvement > Components: PDModel > Reporter: Yonas Jongkind > Fix For: 1.8.0 > > Attachments: PDDocument.java, PDDocument.java.diff > > > 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 was sent by Atlassian JIRA (v6.2#6252)