OpenBoard-org / OpenBoard

OpenBoard is a cross-platform interactive whiteboard application intended for use in a classroom setting.
https://openboard.ch/
GNU General Public License v3.0
2.32k stars 418 forks source link

Invalid PDF for export #897

Open ogodin opened 6 months ago

ogodin commented 6 months ago

Hi everyone,

When I'm exporting an anotated PDF to PDF, I'm getting a warning saying "The original PDF imported in OpenBoard seems not valid and could not be merged with your annotations. Please repair it and then reimport it in OpenBoard. The current export will be done with detailed (heavy) images of the pages of the original PDF instead, to avoid complete export failure."

I never got that warning while using version 1.6.x, but I'm quite new with 1.7.1 and would like to know that this warning is about.

Thanks in advance.

letsfindaway commented 6 months ago

Indeed this message is new with 1.7, but the behavior was the same with 1.6.x.

When you first import a PDF file, annotate it and then export it again, then OpenBoard tries to use the original PDF document and inserts the annotations as graphical objects. For that, it has a built-in PDF merger, which analyzes the original PDF document and modifies it accordingly. This might however not work for some PDF documents using recent features. So there is a fallback solution. If the PDF merger is not able to completely understand the original PDF document, then instead a rendered image of the PDF page is used and the annotations are placed on top of that image.

Visually, there is no difference in the result (except that you would see the rendered pixels when zooming in), but structurally, there is.

The message just wants you make aware of this. But I cannot tell you how to "repair" such a PDF document. Does somebody else have a suggestion for that?

FAN-ZY commented 2 months ago

你好,这个问题我找到原因了,希望能够对你有所帮助! 经过对openbard工具的测试,我发现该工具导出的PDF版本是1.3\1.4较低的版本,所以我们将现在的PDF文件(版本一般都高于1.4)导入后进行编辑,再导出时就会报上面的那个错误。只需要将要编辑的PDF文件进行低版本优化,就可以了。

letsfindaway commented 2 months ago

@FAN-ZY Please translate your comment to English so that others can also read it.