jonjampen / obsidian-xournalpp

Obsidian plugin that seamlessly integrates Xournal++ for handwritten notes and annotations.
https://obsidian.md/plugins?id=xournalpp
GNU General Public License v3.0
20 stars 3 forks source link

pdf annotation overwrite issue #10

Open MarkusHenkel opened 3 weeks ago

MarkusHenkel commented 3 weeks ago

Descripition: There seems to be an issue with the annotation of .pdfs. When I open existing PDFs in Xournal (externally), the xopp file only contains a reference to the original PDF (which gets inserted as page background). Once I save the notes, the Obsidian plugin instantly exports the xopp to a pdf with the same name. However since I just called the xopp the same as the underlying pdf it overwrites the pdf (this is the default). This causes all pages to be blank behind my notes as the reference now loops back to the file itself. This should be easily solvable if the Obsidian plugin could rename the file when exporting, say something like <xopp-name>_obsidian.pdf for example.

Also: Changing the name of the .xopp before saving for some reason results in the same issue. The newly created PDF will have the notes made in Xournal but not the PDF behind it. In this case the annotated pdf wont be destroyed.

To Reproduce Steps to reproduce the behavior:

  1. Open a PDF to annotate in Xournal
  2. Write something in the PDF
  3. Save the xopp
  4. Look at the PDF the plugin created

Expected behavior PDF under the notes annotated.

Operating System and Versions

jonjampen commented 5 days ago

Hi Markus Thanks for reporting this issue!

I understand your reasoning for your suggested approach, however, I think, based on how the plugin is intended to be used, it does not make sense, if the exported PDF file has a different name than the XOPP file.

So opening Xournal++, File > Annotate PDF, selecting the PDF background, and saving that new Xournal++ with a different file name (like filename-annotated.xopp) doesn't work? This would be the way I'd currently recommend and that works well for me. I don't think that should overwrite anything, as your background is filename.pdf, the Xournal++ is filename-annotated.xopp and therefore the exported PDF would be filename-annotated.pdf.

I know that's not an optimal workflow tough and I think, that there should be an automated way to do that with this plugin. However, sadly, Xournal++ does not yet support a command to create a Xournal++ with a PDF background. Someone already implemented that feature (https://github.com/xournalpp/xournalpp/pull/5313), however, it was not yet included in the official release.

I'll think about whether there is another option to implement that, let me know if you have an idea.

Kind regards Jon