相关文章推荐
有胆有识的甘蔗  ·  mongodb并发update-掘金·  1 年前    · 
挂过科的椰子  ·  C 字符串 | 菜鸟教程·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using iText and am very new to it. There have been several situations where I think I could have figured out the problem with my code if I knew what I was doing - I use examples without knowing the workings behind the code, and even as I look at the source I can't figure out what the programmer was thinking.

What does setTextMatrix of contentByteArray in iText do? And how do I figure out the parameter values I need?

For example:

cb.setTextMatrix(1, 0);
  • The input parameters are x,y coordinates in points, unless CTM scaling was defined.
  • 0,0 would be the bottom left of the template you are referencing.
  • The position is the 'baseline' of the text, rather than the top or the bottom.
  • Transcribed from this source: https://sourceforge.net/p/itext/mailman/message/12855218/

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.