GdPicturePdf.DrawText limits

Discussions about PDF management.
Post Reply
uzerzero
Posts: 1
Joined: Fri Aug 14, 2015 9:33 am

GdPicturePdf.DrawText limits

Post by uzerzero » Fri Aug 14, 2015 10:17 am

Hello,

I am working with PDF and I need to insert text into the PDF from an RTF file.
This is no problem with the DrawText() function as descibed in the doc.

However, if I want to insert large amounts of text, Acrobat gives an error for the PDF.
Over 25000 characters and this occurs.
My Gdpicture status returns ok to the DrawText() and the saveFile() but when I open the PDF I have , this page contains an error and may bot be correctly displayed.

What are the limitations of DrawText() ? Or even the limitations of inserting text on to one page ?
For this type of insertion is there another more adpated approach to inserting text ?

For the moment I will split the text and DrawText() it at different points in the PDF, but I would like to understand more about DrawText()

I have been searching in the forum and the documentation for a information but have not been able to find enough.
Many thanks for any info.

Clodagh

Code: Select all

            GdPicturePDF oGdPicturePDF = new GdPicturePDF();
            GdPictureStatus oPDFStatus;
            String text = "";
            bool lSuccess = false;
            if ((oGdPicturePDF.LoadFromFile(sFileName, true) == GdPictureStatus.OK))
            {
                //retrieve text to insert
                text = GetRTFContents(sFileName);
                if(!String.IsNullOrEmpty(text))
                {
               
                   oGdPicturePDF.SelectPage(1);
                   string font_res_name = oGdPicturePDF.AddTrueTypeFont("Arial", false, false, false);
                   oGdPicturePDF.SetTextMode(PdfTextMode.PdfTextModeFill);
                   oGdPicturePDF.SetTextSize(10);
                   oGdPicturePDF.SetFillColor(255, 0, 0, 0);
                   oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
                   oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitPoint);
                   oPDFStatus = oGdPicturePDF.DrawText(font_res_name, 1, 1, text);
                   if (oPDFStatus == GdPictureStatus.OK)
                   {
                       oPDFStatus = oGdPicturePDF.SaveToFile(sFileName);
                       if (oPDFStatus == GdPictureStatus.OK)
                       {
                           lSuccess = true;
                       }
                       else
                       {
                           oLog.Write("[InsertTextIntoPDF] Problem saving file : " + oPDFStatus, cLog.LEVEL._ERROR);
                       }
                   }
                   else
                   {
                       oLog.Write("[InsertTextIntoPDF] Problem inserting text : " + oPDFStatus, cLog.LEVEL._ERROR);
                   } 
                }               
                oGdPicturePDF.CloseDocument()

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: GdPicturePdf.DrawText limits

Post by Loïc » Fri Aug 14, 2015 10:11 pm

Hello Clodagh,

In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please open a ticket on our helpdesk and give us a demo project so that we can conduct further research?

Helpdesk: https://www.gdpicture.com/support/getting-support-from-our-team

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests