I am trying to convert IDML into HTML5 through script, not through InDesign. Everything comes out ok except for the rotated texts in the IDML. When the text is rotated, I take the values from ItemTransform of IDML and follow the geometrical calculations detailed in http://www.adobe.com/products/postscript/pdfs/PLRM.pdf. I get all css values correctly in HTML5 output except the "top" value. If any of you attempted this before, please let me know how to calculate the css values for IDML to HTML5. Thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
When the top/y coordinate is off after rotation, it's usually because you're rotating around a different origin than you think you are. You need to make sure the origin of your rotation is at 0,0 before you rotate, so you typically translate your object to zero, then rotate, then translate it back again. It's hard to be more helpful without seeing some code - an example of the IDML input, your rotate function, and then the html5 output you're getting will probably reveal what the issue is.
This tutorial is Flash-based but is still one of the best explanations I've found of how matrix transformations work: http://www.senocular.com/flash/tutorials/transformmatrix/