I’ve posted this question to the Samsung Developers Forum but did not get any response there, so maybe somebody here can help.
???? Problem
I’m a bit disappointed by the export quality of the Samsung Notes app on my Galaxy Tab S8+ and don’t understand why it doesn’t store vector data inside the PDF. Instead, upon export, Samsung Notes embeds rasterized versions of the pages in the PDF (and none of good quality, like just a bit more than 600px wide for a A4 page).
???? PDF also holds vectorized data?
In a PDF analyzer, I’ve noticed there’s another stream of binary data. This data is probably used such that the Samsung Note app can display the vector graphics again once the PDF is imported back to the app. This works like a charm in the app itself, but it’s not sufficient as I want to share the PDF files in vectorized form with other people as well.
The stream of binary data ends with this string: “Document for S-Pen SDK”. Maybe somebody of you knows how this works: what kind of data does the binary data hold? Apparently it’s more than just “draw a line with that color from coordinates (x1,y1) to coordinates (x2,y2)”. What does it have to do with the S-Pen SDK and can I find any documentation for it online except for standard tutorials that show how to set up an XML file? I’m also not sure how the API reference can help me out with this.
Observation: I exported a PDF that hold a single line. I then exported another PDF where I added a line. Then another one, where I removed the added line. Other than expected, the size of the binary stream always grew, which leads me to think that some kind of history is stored in it.
⛳ Goal
My ultimate goal (maybe not achievable, but why not dream big) is to create a little script than can take a PDF generated by Samsung Notes and extract the “vector graphics” content such that I can create an SVG or even better another PDF that holds the vectorized data to be read by usual PDF viewers. This would drastically reduce the huge file sizes (>10MB for a few pages with handwritten notes) and increase the quality as we wouldn’t deal with rasterized images anymore. This hope is shared by a Reddit user as well. Note I’ve already voted for a feature request at Samsung to export vector graphics, but I doubt this will be acted on quickly.
Thanks in advance for any help and pointers in the right direction.