Samsung Notes S-Pen SDK exported PDF

Hey there, I’m new to this forum. 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.

However, 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”. That’s why I came here: 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.

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 sometimes) and increase the quality as we wouldn’t deal with rasterized images anymore.

Thanks in advance for any help and pointers in the right direction.

2 Likes

Note I’ve just also posted this question to StackOverflow here [edit: broken auto-link to https://stackoverflow.com/q/78659627/9655481 has been removed] . I’ve also provided some sample PDFs over there.

I am also very interested in this feature. It’s a shame that the best note taking app on Samsung Galaxy tablets and phones can’t export anything in vector format.

1 Like

Yeah, it’s really sad. On Reddit, some users go so far as to say that Samsung does this on purpose to keep users in the app, i.e. you need a Samsung phone or at least the app (on a Samsung device) to open the document and see its vectorized content. After Samsung has restricted the use of their Samsung Notes app on laptops to Galaxy Book laptops (see here), I’m not too opposed to believe these rumors to be true.

The bad news is that it’s probably not that easy and very time-consuming to reverse-engineer their proprietary and undocumented (to the public eye) .sdocx format that is essentially stored in these PDFs files (as seen on StockOverflow). I cannot think of another strategy than change one thing in the PDF, export the PDF, change another thing and so on, to find out which bytes change and what they mean. But this might not yield any results. In the best case, developers in the Samsung Notes app team would implement a proper export on their own but I doubt this will happen anytime (soon).

Someone on another post suggest raising the issue to Samsung Members App, I doubt if this will get any satisfactory reply, but still, worth a try!