Sign In  Sign Up Live-Chat

PdfFileMend.AddText vs PdfContentEditor.CreatePolygon coordinate difference

Last post 11-21-2007, 8:27 PM by forever. 2 replies.
Sort Posts: Previous Next
  •  10-26-2007, 3:24 PM 100304

    PdfFileMend.AddText vs PdfContentEditor.CreatePolygon coordinate difference

    Hello!  I'm attempting to use Pdf.Kit to add text with surrounding boxes.  I'm using C#, PdfFileMend.AddText, and PdfContentEditor.CreatePolygon to do so; however I'm having trouble getting them to line up. 

    I created this elemental test to reproduce the issue with a simple "axis" and text, which I expected would rest in the upper-right quadrant of the axis.  It does not, and I'm not sure why;  I'm relatively new to PDF and brand new to Pdf.Kit.  Please investigate for me.

    I run through this code twice, once with PdfFileMend instance "pfm", and once with PdfContentEditor instance "pce":

    Point tOrigin = new Point(10, 10);

    Rectangle tRect = new Rectangle(tOrigin.X-10, tOrigin.Y-10, 20, 20);

    if ( stage == "PdfContentEditor" )

    {

    LineInfo liTestPCE = new LineInfo();

    liTestPCE.LineColor = Color.FromArgb(255,0,0);

    liTestPCE.VerticeCoordinate = new float[12]

    {

    tOrigin.X-tRect.Width/2, tOrigin.Y,

    tOrigin.X+tRect.Width/2, tOrigin.Y,

    tOrigin.X, tOrigin.Y,

    tOrigin.X, tOrigin.Y-tRect.Width/2,

    tOrigin.X, tOrigin.Y+tRect.Width/2,

    tOrigin.X, tOrigin.Y

    };

    pce.CreatePolygon(liTestPCE, pageIdx+1, tRect, "");

    }

    else if ( stage == "PdfFileMend" )

    {

    FormattedText ftText = new FormattedText( "|____",

    Color.FromArgb(0,0,255), Aspose.Pdf.Kit.FontStyle.Courier,

    EncodingType.Winansi, false, 9);

    pfm.AddText( ftText, pageIdx+1, tOrigin.X, tOrigin.Y, tOrigin.X + tRect.Width, tOrigin.Y + tRect.Height );

    }

     

     
  •  10-27-2007, 10:51 PM 100339 in reply to 100304

    Re: PdfFileMend.AddText vs PdfContentEditor.CreatePolygon coordinate difference

    Hi,

    I have checked this problem, and the same problem occurs as you. The cause is we modified the coordinate a little in order to support multi-line text to be added in PdfFileMend.  We will do some work for this problem to support your work. It requires two days.


    Allen Wen
    Developer
    Aspose Changsha Team

     
  •  11-21-2007, 8:27 PM 103551 in reply to 100339

    Re: PdfFileMend.AddText vs PdfContentEditor.CreatePolygon coordinate difference

    Attachment: Present (inaccessible)
    Hi,

    Please try the attachment before we publishing the hotfix.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML