Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6441 Reply

    Alex Black

    Hi, some of my users are experiencing issues where PlugPDF is unable to open the PDF. I suspect the problem is in my code, possibly a race condition, but, I was wondering if you could offer any insight into what might cause this error?
    Thanks, Alex

    java.lang.Exception: Error opening PDF (Exists=true, Path=/storage/emulated/0/WOInvoice/invoice/Kostenvoranschlag_KV0001.pdf)
    1 at com.aadhk.woinvoice.App.void err(android.content.Context,java.lang.String,java.lang.Exception)(ProGuard:626)
    2 at com.aadhk.woinvoice.util.RenderPdfTask.android.graphics.Bitmap doInBackground(java.lang.Void[])(ProGuard:65)
    3 at com.aadhk.woinvoice.util.RenderPdfTask.java.lang.Object doInBackground(java.lang.Object[])(ProGuard:19)
    4 at android.os.AsyncTask$2.call(AsyncTask.java:287)
    5 at java.util.concurrent.FutureTask.run(FutureTask.java:234)
    6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
    7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
    8 at java.lang.Thread.run(Thread.java:856)
    9Caused by: java.lang.Exception: Failed to open /storage/emulated/0/WOInvoice/invoice/Kostenvoranschlag_KV0001.pdf
    10 at com.epapyrus.plugpdf.core.PDFDocument.<init>(ProGuard:98)
    11 at com.aadhk.woinvoice.util.RenderPdfTask.android.graphics.Bitmap doInBackground(java.lang.Void[])(ProGuard:57)
    12 … 6 more

    #6442 Reply

    Alex Black

    I managed to repro this locally somehow, and saw this in the logs too (just before the exception)

    01-27 15:58:12.960 32457-32537/com.aadhk.woinvoice E/native﹕ plugpdf.cpp:304
    Syntax Error: could not find catalog at line 354 (Gf_Error* Pdf_File::repairXref(streams::InputStream*) : jni/../../../../ext/pdfv/src/file/file_repair.cpp) line 332 (Gf_Error* Pdf_Document::repair(streams::InputStream*, const string&) : jni/../../../../ext/pdfv/src/document/pdf_doc.cpp)

    #6443 Reply

    Dr. Plug
    Moderator

    Hi Alex,

    That log is printed when our SDK fail to repair damaged PDF. Maybe its seems damage to as much as not be able to see. I try check your PDF file. So, could you send to me your PDF file at ‘support@plugpdf.com’?

    Thanks,
    Dr.Plug

    #6444 Reply

    Alex Black

    My app generates a PDF and then uses PlugPDF to render it to an image. It looks like a race-condition type issue, where maybe the PDF was not yet finished generating when I asked PlugPDF to render it.

    I think I’ve got things figured out, thanks.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Failed to open
Your information: