Converting IDML to HTML5 thru script

不打扰是莪最后的温柔 提交于 2019-12-11 04:06:39

问题


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/



来源:https://stackoverflow.com/questions/12326342/converting-idml-to-html5-thru-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!