pdfAnnotate icon indicating copy to clipboard operation
pdfAnnotate copied to clipboard

Error creating annotations with higher versions of pdf

Open ishanuda opened this issue 6 years ago • 6 comments

hi, I loaded 2 pdf files and got some errors as follows.

Error 01: error-01

Error 02: error-02

However, I noticed that by opening the PDF files with notepad++ the PDF version is different than the PDF version that you have in the pdfjsExample.html file.

Default PDF in the example: compressed.tracemonkey-pldi-09.pdf version

doc-type-1

Error 01 related PDF version:

doc-type-2

Error 02 related PDF version:

doc-type-3

Please be kind to look for the following errors. Regards

ishanuda avatar Sep 16 '19 16:09 ishanuda

I just released version 1.0.9. Can you try it with this one? Otherwise can you provide me with an example of a PDF that fails? Otherwise it is really hard to fix whats going wrong.

highkite avatar Sep 25 '19 11:09 highkite

I just cloned the repo and tried with PDF versions, and found out that when downloading the PDF is empty. Also, install the v1.0.10 from NPM repo and got the same errors as mentioned above.

I think you can try with PDF v1.5, v1.6, and 1.7, the errors will be generated as above.

Also in the PDF spec, it says that the cross-reference table is no longer using in the PDF v1.5 and above and the cross-reference stream instead.

Is the current library support cross-reference streams and high-bridge versions for backward compatibility whose the PDF versions 1.4 and below that is not supporting for cross-reference streams?

looking forward. Thank you very much for your reply.

ishanuda avatar Sep 25 '19 15:09 ishanuda

I added support for flate decoded cross reference streams. It is a bit shaky at the moment. I need to test it extensively and improve some things. Is it working with your documents?

highkite avatar Oct 01 '19 15:10 highkite

Hi, I checked out the changes and tested the pdf versions from v1.1 to v1.7. All seems good and thank you for the update. However, some of the files did not update as expected. Also, all files were checked for text annotations.

Some other annotations such as 01. underline did not underline at the bottom of the text instead the line appeared top of the text. 02. circle did not annotate.

NOTE: Other annot types may also have similar behaviors.

Annot that did not create at all are attached. examples.zip

Thank you very much

ishanuda avatar Oct 16 '19 07:10 ishanuda

Hi, Any update on this feature?

ishanuda avatar Jan 11 '20 16:01 ishanuda

@highkite Hi, I'm the user of your annotpdf library. I still have such same problem that @ishanuda had before. I am implementing a web application editing pdf files.

The problem occurs when I follow the steps with pdf files of version 1.7. 1) load pdf file using the function "pdfjs.getDocument(pdfdata).promise." 2) add some annotation with the function "createTextAnnotation" 3) save result file using the function "factory.download" => I could not open the result pdf file using adobe reader and not load result file using the function of 1).

but when I did same steps with pdf file version 1.4, It worked fine. Could you plz check what's wrong or fix the issue?

I attach the sample pdf file below which has a version above 1.4. you could try some tests with it. https://cdn.datalogics.com/www/pdf/Appendix_C_from_pdf_reference.pdf

HyunjiEllenPak avatar Jan 24 '22 06:01 HyunjiEllenPak