Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

HPDF_Page_SetTextMatrix problem?

Help
Ade
2007-04-18
2013-04-25
  • Ade
    Ade
    2007-04-18

    Hi,

    I know how to use HPDF_Page_SetTextMatrix to rotate and scale text but I can only seem to use one of these operations at a time.

    According to the Adobe PDF Specification, if I am reading it correctly, you should be able to set multiple text matrices and they will be applied one after another so that you could set up a rotation first using HPDF_Page_SetTextMatrix and then immediately set up a scaling operation by using HPDF_Page_SetTextMatrix again.

    eg:
    // rotate by 45 degrees
    HPDF_REAL rad = (HPDF_REAL) 45.0 / 180.0 * 3.141592;
    HPDF_Page_SetTextMatrix(page, cos(rad), sin(rad), -sin(rad), cos(rad), x, y);
    // scale in x direction by 1.5 - ie make the text wider than normal
    HPDF_Page_SetTextMatrix(page, 1.5, 0, 0, 1, x, y);

    When I try and do this only the last HPDF_Page_SetTextMatrix operation works.

    Have I understood the Adobe PDF specification correctly? If so, any chance of the library being changed so that it will record up to three text matrix operations (as this would allow for a rotation, skew and scaling to be applied to one piece of text)?

    Best regards,
    Adrian Nelson

     
    • Rimidalv
      Rimidalv
      2007-05-03

      Bonjour!
      Multiple 2 matrix before call HPDF_Page_SetTextMatrix.
      i.e. use HPDF_Page_SetTextMatrix(page, 1.5 * cos(rad), 1.5 * sin(rad), -sin(rad), cos(rad), x, y);

       
      • Ade
        Ade
        2007-05-03

        Hello,

        Thank you very much for your suggestion - it worked just fine.

        Best regards,
        Adrian