Allow overwriting background PDF files
Describe the solution you'd like
It would be good to allow users overwriting background PDF files (with proper warning about impossibility of further editing and cleaning/removing .xopp file).
Describe alternatives you've considered Exporting into another pdf file and removing the previous file after ending work with file is a messy solution.
Additional context My workflow during working with PDF-s at university is like this, during lecture I am opening presentation (in form of pdf) provided by the teacher and put notes and valuable comments during lecture, I am saving file (and I am not going to work with it using xournal++ anymore), later these files are synchronized with cloud and I would like to have an access to annotated versions on devices without xournal++.
I would like to have an access to annotated versions on devices without xournal++
It seems to me that the core issue here is having some sort of auto-export feature. Maybe this could be done with a plugin.
For me, it is just annoying that app doesn't let me to overwrite this file, even if I am aware of its consequences.
I think the simplest solution would be adding here button "force overwriting" (or something similar) and ensure clearing/deleting old .xopp file after this.

But in my opinion plugin dealing with auto-exporting would be great, although I am not sure how it should be done to still allow editing file without any problems.
I don't really like the force overwriting solution because it would effectively "desync" the annotations from the PDF, making the annotation file essentially useless afterwards.
But in my opinion plugin dealing with auto-exporting would be great, although I am not sure how it should be done to still allow editing file without any problems.
Here are my thoughts on how the plugin might work:
- Let's suppose we have PDF background file
lecture.pdfand annotationsnotes.xopp. - The plugin (or whatever the final implementation ends up being) will allow the user to set an "auto export" directory
$MY_EXPORT_DIR. - At regular time intervals, or whenever the user saves the annotations, the plugin will export
notes.pdf(or some other configurable file name) to$MY_EXPORT_DIR.
This way, the annotations can always be edited because the auto-export plugin only creates a copy.
I believe both of these features have their use cases, and both should be implemented.
I personally would prefer the force overwriting option. I use Xournal++ to fill out assignments I have. When I am finished editing the assignment, I would like to save it over the same pdf file to keep things organized and since I won't change it anymore. It has been frustrating to say, download a HW01.pdf, edit it, then save it as HW01-complete.pdf to submit it. I don't need to edit the annotations anymore, and I just end up deleting the extra files when I am done.
On the other hand, I see why an auto-exporting script might be helpful, especially if you have a document that you are regularly sharing with others.
I think both options should be implemented, and the option to force override would be easiest to implement first.
Plus one on the ability to overwrite! I mainly use xournal for my accounting needs, embedding the comments into my receipts is required by law. This used to be possible with xournal, but somehow not any more with ++...
I would also like the ability to overwrite the background PDF, ideally with 2 clicks. I keep using Xournal to grade exams because it allows overwriting the background file. It does require quite many clicks, but is still easier than renaming or even mass renaming the files later.
As a precaution, the original PDF can be saved as a backup (e.g. append .bak.NNN to the file name).
The UI could be as follows: replace "Do not overwrite background PDF.." dialog by "Do you want to overwrite the background PDF file? If you do, the annotations can no longer be edited." with options "Overwrite", "Cancel" and a checkbox "Save the original PDF as a backup", checked by default.
@pzorin If you overwrite the background PDF, should the xopp-document be cleared from any annotations and reloaded with the overwritten PDF?
I don't like the way xournal does it. When you annotate a pdf, add a blank page somewhere, export and overwrite the pdf, save the xoj-file and reload the xoj-file you get duplicated pages and duplicated annotations. I think that whenever you save a xopp-file and reload it, you should still see the same document. That's why I suggest clearing the xopp-document and reloading the pdf if you overwrite the background pdf.
If a backup PDF is created, the xopp-file should be renamed to something with .bak and point to the backup PDF (naming scheme should be consistent for .pdf and .xopp backup files). If no backup is created, the xopp-file should be removed. In both cases, the PDF should be reloaded, with no associated xopp-file. PS: I am not sure how restoring the backup would work; is there a mechanism for renaming the background file in a xopp-file?
I edited a form PDF, then saved it, but had to sign with my pen input... for which I used Xournal. Unfortunately after exporting over the original PDF, I found an error in the form field data... but I'm finding I cannot select the background layer and delete a rectangle... nor does it seem like I can draw a rectangle of white color. This is a major feature gap.
@nmz787 You can draw a rectangle of White color. Just make sure to set the opacity to 100% in menu Tools > Pen Options > Opacity.
@rolandlo I don't have an Opacity option there, just thicknesses. Also I don't see a way to draw a shape/rectangle, only select rectangle from the icon toolbar. Running Xournal 0.4.8/2106 on antix distro Linux nathan 4.9.212-antix.1-amd64-smp #1 SMP PREEMPT Fri Jan 31 22:19:43 EET 2020 x86_64 GNU/Linux
oops, looks like xournal is a different codebase than this repo!
@nmz787 Yes, this is the issue tracker of Xournal++, not Xournal. I missed that you use Xournal (which hasn't been maintained for years). Why don't you try out Xournal++? Here is the link to the installation page (you can also download the AppImage, which doesn't need installation).
For me this lead to a lot of confusion as I did not even understood what the dialogue was telling me until I found this issue. Maybe it should be clarified to "This PDF file is used as the background for the .xopp document. Please save it under a different name." and then it could be expanded in the future to "Overwriting it will disable further modification of annotations! Proceed?".
Also maybe it could be possible to embed the original PDF in the xopp file?
PDF embedding is being worked on with the new file format (#937), but it will take a while before it makes it to an actual release.
PDF embedding is being worked on with the new file format (#937), but it will take a while before it makes it to an actual release.
@Technius how soon can we expect this to work? Any rough eta?
Coming back to this issue after a few months, I agree that it would be easiest and most useful to provide a button to forcefully overwrite the background PDF in the dialog. To summarize the suggestions from this issue:
- The error message should suggest the alternative option of renaming the exported file.
- We can add a button or a checkbox to the dialog that allows users to force overwrite the background PDF.
- It would be useful to generate a backup file in case of user error. However, in some use cases, the backup is just extra clutter and should not be generated.
- One proposed solution is add a checkbox that toggles whether to create a backup (enabled by default).
- Another potential solution that I thought up while writing this comment: always create the backup file, but put it into an out-of-the-way location like the autosave folder.
- To deal with the annotation consistency problem, we should delete all annotations after the background PDF is overwritten, and then reload the background PDF.
- If there is a corresponding
.xoppfile, the annotations need to be cleared from the file as well.
- If there is a corresponding
Is there any update on this issue, by any chance? :)
Also asking. Are there any updates?
any updates?
any updates?
For now, I just switched to the Okular from KDE as a tool for annotating PDFs.
It just fits my PDF workflow better and allows me to easily migrate my annotations between devices.
I'm using a script that I execute after making changes to my Xournal++ files, which creates a third, generated pdf file next to the original pdf and the xournalpp file.
For the record, i have used Microsoft Edge for this purpose and it seems like works pretty well.