0
votes

I have a Ruby on Rails back-end service that takes individual PDF documents and combines them into a consolidated PDF - app uses Wicked-PDF ruby gem for generation.

When the PDF is viewed through the browser's default document viewer for PDF, the full document is visible. However, when the document is downloaded and viewed through Adobe Reader or Acrobat, only a part of the document will be fully rendered and then I receive an error "Problem reading this document (14)" with all of the remaining pages turning into small blank thumbnail-like pages, almost like it is corrupted - however, it is not corrupted because it is fully viewable in the browser.

The error has occurred on multiple documents in inconsistent locations, so it seems like it might be related to the particular document being compiled into the full PDF document, but haven't been able to isolate the cause.

Has anyone else encountered this issue w/ the Wicked-PDF package gem?

1
I use wicked-pdf gem too and I never got that error. You should show us some code, it would help. Show us your download procedure, how you download the pdf. What version of the gem you have ? What is your operating system ? - Volodymyr Balytskyy

1 Answers

0
votes

We identified that the issue was actually in the combine_pdf gem we were using to do the document compilation. The error is caused when two or more documents share the exact same content, ie. they are the same file, regardless of their file name. We are now commparing each document to all others before compilation to ensure that it will not generate an error.