xournalpp-relative-background/README.md

53 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2021-09-22 22:10:35 +02:00
# Relative Xournal++ background paths
Replace absolute paths of Xournal++ PDF backgrounds with relative ones.
## Installation
2022-03-12 14:18:13 +01:00
Save [the script](relative-xopp-background) under
- `~/.local/share/nautilus/scripts/relative-xopp-background` (for `GNOME Files`/`Nautilus`)
- `~/.local/share/nemo/scripts/relative-xopp-background` (for `Nemo`)
and make it executable:
- `chmod +x <script-path>`
2021-09-22 22:10:35 +02:00
2021-12-18 21:54:03 +01:00
Optional: Install [notify2](https://pypi.org/project/notify2/) and
2021-09-22 22:10:35 +02:00
[dbus-python](https://pypi.org/project/dbus-python/) with your package manager or with pip.
2021-09-25 19:53:14 +02:00
## Details
Here is an excerpt of a Xournal++ document `/home/user/notes/note1/paper.pdf.xopp`:
```xml
<?xml version="1.0" standalone="no"?>
<xournal creator="Xournal++ 1.1.0" fileversion="4">
<title>Xournal++ document - see https://github.com/xournalpp/xournalpp</title>
<!-- ... -->
<page width="595.27600000" height="841.89000000">
<background type="pdf" domain="absolute"
filename="/home/user/Documents/paper.pdf" pageno="1ll"/>
<!-- ... -->
</page>
<!-- ... -->
</xournal>
```
If `/home/user/notes/note1/paper.pdf` is accessible (in the same folder as the Xournal++ file),
then the absolute path will be replaced with a path **relative** one:
2021-09-25 19:53:14 +02:00
```xml
<?xml version="1.0" standalone="no"?>
<xournal creator="Xournal++ 1.1.0" fileversion="4">
<title>Xournal++ document - see https://github.com/xournalpp/xournalpp</title>
<!-- ... -->
<page width="595.27600000" height="841.89000000">
<background type="pdf" domain="absolute"
filename="paper.pdf" pageno="1ll"/>
<!-- ... -->
</page>
<!-- ... -->
</xournal>
```