Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error/Crash with function BE_PDFPageCount after being called multiple times on a large PDF #224

Open
bowdendata opened this issue Jul 9, 2024 · 3 comments

Comments

@bowdendata
Copy link

Describe the bug
In a script that is running as PSOS, we are building a PDF report in the Windows TEMP folder by creating an initial PDF using the FM function of Save Records As PDF. We are then looping and using the Save Records As PDF with the Append option. During each loop after appending to the PDF, we are calling the BE_PDFPageCount ( pdfPath ) function. During the 251st loop, the FM Server scripting engine is crashing with a 701 error.

At the time the scripting engine fails, the PDF has right around 757 pages in it and it is about 32MB in size.

To Reproduce
We need to know :

  1. Which functions you called: BE_PDFPageCount ( pdfPath )
  2. What were the parameter values you used: pdfPath is a file reference to the PDF in the Windows TEMP directory.
  3. What the output was: Prior to the crash, the plugin call was returning the page count properly.
  4. Other potential debug information: When the FM Server scripting engine terminates, we have a "DMP" file generated.

Expected behavior
The plugin is able to read the page count for PDF's that very large in size.

Desktop (please complete the following information):

  • OS and version : Windows Server 2019
  • FileMaker Version: FileMaker Server 20.3.1.x and 21.0.1.51
  • Plugin Version from BE_VersionAutoUpdate: 05000002

Additional context

  • Only using this one BE function in the script.
  • Output of the BE_DebugInformation function is not known at this time. I can see about getting this.

If the trace/debug is large, you may need to save that to a text file and attach separately.

@nickorr
Copy link
Member

nickorr commented Jul 10, 2024

Doug,

Thanks for all that info. Do you have any completed pdfs you can test with? I'm wondering if the issue is due to the size of the file being beyond what the PDF library can cope with, or whether it's an issue with being called that many times.

Are you able to test the page count function on the same environment ( via FMS etc ) on one of the very large files?

Alternatively are you able to generate the page count less often, or before the append?

Or I may be able to come up with other command line ways of doing that.

At the moment we're in a big rebuild process of the base podofo library, so that may fix a bug but will take a while to complete.

Cheers,
Nick

@bowdendata
Copy link
Author

bowdendata commented Jul 11, 2024 via email

@nickorr
Copy link
Member

nickorr commented Jul 11, 2024

We're on a fairly old release of the podofo library, but it seems like their might be a point release that fixes a memory allocation bug on large PDF files :

https://sourceforge.net/p/podofo/code/2038/

As best I can tell, this is fixed in 0.9.8 and we're on 0.9.7, so I may be able to update to that.

( Podofo switched to a new API structure for 0.10 and now all our code needs to be re-written, so that will be a lot of work, but the bug fix is before that change I think. )

I don't know when I can have a new build ready for windows though, I've been working on the library re-compiles for Mac and Linux, and haven't started on Windows yet ... If you know any C coding people with Windows Visual Studio experience, let me know.

Cheers,
Nick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants