-
Notifications
You must be signed in to change notification settings - Fork 204
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
Working v8 sample to load file in win-x64 or win-x86 #105
Comments
Hi @wickyhu, With the recent builds, you no longer need to call I last tested the V8 build some time ago; maybe an upstream change is causing a bug now. Best regards, |
Hi Benoit, Thank you for the quick reply. Thanks~ |
I just ran a test program: it doesn't crash, but some elements are missing, so there is definitely something wrong. |
Hi, bblanchon, I have a fork of PdfiumViewer, which I combined some enhancements from others. I changed the package to bblanchon.PDFium.V8.Win32 just now.
I guessed I need to do some initilization for v8 to make it working. Thanks~ |
I've been facing similar problems with a crash at |
I've been using |
@mara004, my test program calls |
With pypdfium2, the crash is constantly reproducible:
|
I updated the example to call |
Hi, bblanchon, I just tried the example.c in my environment: I created an empty C++ console project named test, and build example.c with latest downloaded pdfium-v8-win-x64.tgz. Below are my steps and findings: Case 1: form_callbacks.version = 1
Case 2: form_callbacks.version = 2
Best Regards |
Hi, bblanchon, One more information for Case 2:
Best Regards |
Hi, bblanchon, I further tried example.c with pdfium-win-x64.tgz, which is non-v8 version. Case 1: version=1, no error, returned form of FPDFDOC_InitFormFillEnvironment is not zero, but out.pdf is corrupted Best Regards |
Hi Wicky, Thank you very much for this information; there may be a problem with the initialization of XFA. I'll look into that. The output from Best regards, |
Hi bblanchon, Got it, I can open out.ppm now. Best Regards |
I added a call to |
Hi Benoit, I just re-downloaded the v8 x64 binary from home page, it seems same as previous version. Thank you very much for the so quick reponse! Best Regards |
You can download the build artifacts here: |
Sounds good, thanks! |
Also thanks a lot to @wickyhu for reporting this! |
I’m closing this; don’t hesitate to open a new issue. |
Hi Benoit, I just tested example.c with latest binaries.
The new build works in my project now. Best Regards |
The comment you referred to previously gives an explanation:
To me, this explains why |
Yes, you are correct, it's reasonable. Thanks~~ |
Fix confirmed with yesterday's build. pypdfium2's test suite now runs as expected with the V8 binaries. |
Hi @bblanchon, A pypdfium2 user is asking for XFA support (pypdfium2-team/pypdfium2#221), and we both figured out that Is it possible there is still something wrong with XFA init? Thanks! |
@mara004, I saw your message, and I plan on testing this function soon, but I'm overwhelmed at the moment. |
Thanks for the response. Take your time. :) I already guessed you might be away or else busy. |
FYI, there's been a report on pdfium's mailing list concerning an out-of-memory error on library init with iOS. Is it possible this is caused by the pdfium-binaries V8 patch? |
The last message on the thread says:
I'll assume that this was the issue. |
Yeah, sounds like it had nothing to do with the V8 patch after all. Sorry for the disruption. |
Hi @bblanchon, |
Thank you for reaching out. You're right; this issue got out of my attention. |
This comment was marked as outdated.
This comment was marked as outdated.
Nevermind, when setting |
I made some discoveries:
Something along those lines: IPDF_JSPLATFORM platform_callbacks = {0};
platform_callbacks.version = 3;
FPDF_FORMFILLINFO form_callbacks = {0};
form_callbacks.version = 2;
form_callbacks.m_pJsPlatform = &platform_callbacks;
FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks);
FPDF_LoadXFA(doc); When you do this, However, when we call
There is undoubtedly something wrong with my patch to this function, but it's late, so I must stop here for today. |
Gotcha, thanks for the pre-requisites checklist, that was an eye-opener. My sample now renders correctly. I didn't have trouble with crashes on library destruction yet. Anyway, thanks a lot! |
I finally found what was causing the assertion failure: you must call |
Yeah I think the API contract with pdfium is that objects should be closed in reverse order to loading. |
Hi,
I'm looking for a working sample with v8 win-x64 or win-x86 binaries.
I was successful with common binaries to load and render pdf, but always get memory access violation when swiched to v8 binaries.
I searched and found FPDF_InitEmbeddedLibraries in comments, but seems it is not found in v8 dll.
Could you advice me correct initial steps for v8?
Thanks!
Wicky Hu
The text was updated successfully, but these errors were encountered: