Forum moved here!

Home / Convert Adobe highlight to SMX

Ritche_Regala

Hi,
Is there a way to convert the Adobe highlight format to SMX format?
pg=1 pos=4 len=8 (Page 1, Starting at 4th character, highlight 8 characters)
TO
page = 1 rect = 36 220 493 18 (Page 1, highlight rectangle with coordinates 36, 220, 493, 18)
There is no direct way to convert from offset to rectangle. How to do modify the code to produce SMX by character/word offset instead of rectangle coordinates?
Thanks a lot :pray::pray::pray:.

GitHubRulesOK

SMX is dead long live annotations (its a pity since I used .smx a lot)

Unfortunatly .smx files are no longer supported after version 3.2
Whilst converting external .smx entries to internal pdf annotations was easy the opposite is not the case unless you program a text conversion after using an export tool or do it manually

Taking your example there would need to be some translation as to where the 4th character starts in page units 36, 220 then a means to determine character width and heights to set the delta values 493, 18

The only way SumatraPDF helps is to use the M(easure) tool to show the co-ords of the first value pair then ctrl drag to see the offset values but that then needs rounding off
image

the smx would be

[highlight]
page = 1
rect = 93.2000 145.2000 71.0000 58.0000
color = #5f00a0
opacity = 1

Not sure wher you get the idea that acrobat stores by character and offset it uses absolute values for rectangles so the above simple smx would in the pdf be

23 0 obj
<</Type/Annot/Subtype/Highlight/Rect[93.2000 638.2000 164.2000 696.2000/C[0 0 1]/F 4/P 11 0 R/QuadPoints[93.2000 696.2000 164.2000 696.2000 93.2000  638.2000 164.2000 638.2000]/AP<</N 24 0 R>>>>
endobj

there is no relative 71 or 58

Back to the future (see here how the date for that Highlight was done in 1969 !)

using the current NON SMX version we can read the potential SMX relative values as converted from the acrobat absolute ones. So there is the answer

Ritche_Regala

Thanks for pointing me in the right direction :+1::+1::+1:. The annotation file is very useful for automatic highlighting of multiple search terms using data generated from another search application. I hope there’s a way to save the annotation in a separate file for the current pre-release version similar to the SMX file.

GitHubRulesOK

Sorry but the developer has removed the smx read and write abilities, which worked with txt chm and ebooks in FixedUI mode. The current development is to write more types temporarily into memory or directly into the pdf.

Last official .smx based reader was 3.2
Last pre-release writer/reader was pre-rel about 3.3.13011

I do not know the current situation, but the only other pdf reader, that I know, that used a similar technique in the past was Okular and there is a daily windows version however I think there were rumblings that it too would drop external annotation files. ( I could not get them working, last time) But this years current manual says " Annotations:- Okular has two different kind of annotations" so you can save to PDF (with highlights appended) or to .okular which will be different (more powerful?) compared to .smx but can be used the same way