You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2019/07/19 17:07:00 UTC

[jira] [Comment Edited] (PDFBOX-4601) in AWS lambda pdf merge giving error as Error in pdf consolidation: Expected scratch file size of 196608 but found 192512

    [ https://issues.apache.org/jira/browse/PDFBOX-4601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16889018#comment-16889018 ] 

Tilman Hausherr edited comment on PDFBOX-4601 at 7/19/19 5:06 PM:
------------------------------------------------------------------

targetting to 2.0.17 so we don't forget.

I'm doing a build on the CI server and will tell you when done. You need to set debug logging. Can you do that, and do you see your log output?

And thanks for noticing the "always true" condition. I assume that the developer meant to write {{maxPageCount}} but I need to test this first. I also think it should be "<=" instead of ">".
 cc [~tboehme]


was (Author: tilman):
targetting to 2.0.17 so we don't forget.

I'm doing a build on the CI server and will tell you when done. You need to set debug logging. Can you do that, and do you see your log output?

And thanks for noticing the "always true" condition. I assume that the developer meant to write {{maxPageCount}} but I need to test this first. I also think it should be "<" instead of ">".
cc [~tboehme]

> in AWS lambda pdf merge giving error as Error in pdf consolidation: Expected scratch file size of 196608 but found 192512
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4601
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4601
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.12, 2.0.16
>         Environment: AWS Lambda
>            Reporter: biswajit
>            Priority: Major
>             Fix For: 2.0.17
>
>
> in AWS lambda pdf merge giving error as
> {{Error in pdf consolidation: Expected scratch file size of 196608 but found 192512.}}
> *Code:*
> {code}
> PDFMergerUtility pdfMerger = new PDFMergerUtility();
> pdfMerger.addSources(sources);
> pdfMerger.setDestinationStream(mergedPDFOutputStream);
> pdfMerger.mergeDocuments(MemoryUsageSetting.setupTempFileOnly());
> {code}
> both InputStream and OutputStream are ByteArrayInputStream and ByteArrayOutputStream. AWS Lambda environment has 512MB space available only for /tmp partition. This could be an issue or not I am not sure. And AWS lambda do not permit other directory than /tmp partition to create files.
> And while reading into the code I found below piece of code which I think always be true. Because if you add some constant amount to an integer that will always be constant amount greater than its original value
> in ScratchFile.java => enlarge() method:
> {code}
> if (pageCount + ENLARGE_PAGE_COUNT > pageCount)
> {
>   fileLen += ENLARGE_PAGE_COUNT * PAGE_SIZE;
>   raf.setLength(fileLen);
>   freePages.set(pageCount, pageCount + ENLARGE_PAGE_COUNT);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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