[ 
https://issues.apache.org/jira/browse/PDFBOX-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-2644:
------------------------------------
    Description: 
Load FDF document creates Temp file when called with file parameter, as shown 
by this stack trace from 
https://stackoverflow.com/questions/28229085/temp-file-creation-error-on-gae-with-pdfbox
{code}
com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException: 
The RuntimeException could not be mapped to a response, re-throwing to the HTTP 
container
java.lang.SecurityException: Unable to create temporary file
        at java.io.File.checkAndCreate(File.java:1873)
        at java.io.File.createTempFile(File.java:1968)
        at java.io.File.createTempFile(File.java:2013)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.createTmpFile(NonSequentialPDFParser.java:298)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:278)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:264)
        at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:200)
        at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:172)
{code}
and this source code
{code}
        File pdfFile = new File("resources/GenerateFDF.pdf");
        File fdfFile = new File("resources/fdftest.fdf");

        PDDocument pdfDoc = PDDocument.load(pdfFile);
        FDFDocument fdfDoc = FDFDocument.load(fdfFile);
{code}
I had a quick look at the sources of FDFDocument:
{code}
    public static FDFDocument load( File file ) throws IOException
    {
        return load( new BufferedInputStream( new FileInputStream( file ) ) );
    }
{code}
Is it needed this way, i.e. can't the NonSequentialPDFParser constructor be 
called instead, as it is done when opening a *P*DF Document?

  was:
Load FDF document creates Temp file when called with file parameter, as shown 
by this stack trace from 
https://stackoverflow.com/questions/28229085/temp-file-creation-error-on-gae-with-pdfbox
{code}
com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException: 
The RuntimeException could not be mapped to a response, re-throwing to the HTTP 
container
java.lang.SecurityException: Unable to create temporary file
        at java.io.File.checkAndCreate(File.java:1873)
        at java.io.File.createTempFile(File.java:1968)
        at java.io.File.createTempFile(File.java:2013)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.createTmpFile(NonSequentialPDFParser.java:298)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:278)
        at 
org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:264)
        at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:200)
        at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:172)
{code}
and this source code
{code}
        File pdfFile = new File("resources/GenerateFDF.pdf");
        File fdfFile = new File("resources/fdftest.fdf");

        PDDocument pdfDoc = PDDocument.load(pdfFile);
        FDFDocument fdfDoc = FDFDocument.load(fdfFile);
{code}
I had a quick look at the sources of FDFDocument:
{code}
    public static FDFDocument load( String filename ) throws IOException
    {
        return load( new BufferedInputStream( new FileInputStream( filename ) ) 
);
    }
{code}
Is it needed this way, i.e. can't the NonSequentialPDFParser be called like 
with load PDF Document?


> Load FDF document creates Temp file when called with file parameter
> -------------------------------------------------------------------
>
>                 Key: PDFBOX-2644
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2644
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>            Reporter: Tilman Hausherr
>
> Load FDF document creates Temp file when called with file parameter, as shown 
> by this stack trace from 
> https://stackoverflow.com/questions/28229085/temp-file-creation-error-on-gae-with-pdfbox
> {code}
> com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException: 
> The RuntimeException could not be mapped to a response, re-throwing to the 
> HTTP container
> java.lang.SecurityException: Unable to create temporary file
>       at java.io.File.checkAndCreate(File.java:1873)
>       at java.io.File.createTempFile(File.java:1968)
>       at java.io.File.createTempFile(File.java:2013)
>       at 
> org.apache.pdfbox.pdfparser.NonSequentialPDFParser.createTmpFile(NonSequentialPDFParser.java:298)
>       at 
> org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:278)
>       at 
> org.apache.pdfbox.pdfparser.NonSequentialPDFParser.<init>(NonSequentialPDFParser.java:264)
>       at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:200)
>       at org.apache.pdfbox.pdmodel.fdf.FDFDocument.load(FDFDocument.java:172)
> {code}
> and this source code
> {code}
>         File pdfFile = new File("resources/GenerateFDF.pdf");
>         File fdfFile = new File("resources/fdftest.fdf");
>         PDDocument pdfDoc = PDDocument.load(pdfFile);
>         FDFDocument fdfDoc = FDFDocument.load(fdfFile);
> {code}
> I had a quick look at the sources of FDFDocument:
> {code}
>     public static FDFDocument load( File file ) throws IOException
>     {
>         return load( new BufferedInputStream( new FileInputStream( file ) ) );
>     }
> {code}
> Is it needed this way, i.e. can't the NonSequentialPDFParser constructor be 
> called instead, as it is done when opening a *P*DF Document?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to