3 ms·
One of the nice things about Xournalpp is that is just plain XML (the save file). So its really just plaintext, I don't have to bother with reading hundreds of
by frfl 3y ago
One of the nice things about Xournalpp is that is just plain XML (the save file). So its really just plaintext, I don't have to bother with reading hundreds of pages of PDF spec to try and write a reader in the future. If I needed to, I only need to write an application capable of rendering a PDF page, then drawing text/lines as described by the XML. Assuming libraries to render the PDF will continue to exist in this theoretical future we're describing here.
<stroke tool="highlighter" color="#00ff007f" width="7.86" fill="60" capStyle="butt">254.802 713.98302 283.955 713.98302</stroke>
<stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">283.955 714.01302 539.992 714.01302</stroke>
<stroke tool="highlighter" color="#00ff007f" width="0" fill="60" capStyle="butt">539.992 718.51302 539.992 718.51302</stroke>
<text font="Sans" size="8" x="456.87471" y="427.46622" color="#ff0000ff" ts="0" fn="">Here the first capture group is
`([\"'])`, which captures either a
`"` or a `'`. Then the `(.-)` lazy matches
any thing, and finally `%1` matches
the original type of (closing) quote</text>
</layer>
</page>
<page width="612" height="792">
<background type="pdf" pageno="95"/>
<layer>
<stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">120 78 169.674 78</stroke>
<stroke tool="highlighter" color="#00ff007f" width="7.86" fill="60" capStyle="butt">265.784 77.97 292.676 77.97</stroke>
<stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">292.676 78 397.442 78</stroke>
- wolverine876 3y agoVery cool. One thing I dislike about PDFs is the complexity, and like you I do use text when possible (text files aren't so great if I want to annotate them, unfortunately). Out of curiosity, is that SVG (which is an XML)?
- frfl 3y agoI think it's just XML, not SVG. <?xml version="1.0" standalone="no"?> <xournal creator="xournalpp 1.2.2" fileversion="4"> <title>Xournal++ document - see </title> <preview>iVBORw0KGgoAAAANSUhE...............</preview> <page width="612" height="792"> <background type="pdf" domain="absolute" filename="somebook.pdf" pageno="1"/> <layer/> </page> <page width="612" height="792"> <background type="pdf" pageno="2"/> <layer/> </page> ... <page width="612" height="792"> <background type="pdf" pageno="16"/> <layer> <stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">120 457.20601 540 457.20601</stroke> <stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">394.78 515.76399 540.01 515.76399</stroke> <stroke tool="highlighter" color="#00ff007f" width="0" fill="60" capStyle="butt">540.01 520.26399 540.01 520.26399</stroke> <stroke tool="highlighter" color="#00ff007f" width="9" fill="60" capStyle="butt">120 527.76399 156.1 527.76399</stroke> </layer> </page> Here's the top of the file for context.