pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

Examples for Subscripts / Superscripts?

Open hikaru150s opened this issue 3 years ago • 1 comments

Is there any way to set portion of text to subscripts/superscripts? If it's not implemented, could you tell me where it could be implemented?

Thanks

hikaru150s avatar Apr 20 '21 08:04 hikaru150s

This is not supported it pdfjs right now. I haven't looked in detail into how to make this happen, but I am aware of the Ts command in the PDF specification:

Set the text rise, Trise, to rise, which is a number expressed in unscaled text space units. Initial value: 0.

This and/or font-size and baseline changes are probably the tools to make it happen. https://github.com/rkusa/pdfjs/blob/master/lib/text.js#L331 might be a good place to make adjustments for subscripts/superscripts text.

rkusa avatar Apr 22 '21 09:04 rkusa