We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Text not showing on pdf?

Thread ID:

Created:

Updated:

Platform:

Replies:

89879 Sep 9,2009 11:06 AM Sep 15,2009 07:40 AM ASP.NET Web Forms (Classic) 2
loading
Tags: PDF
Daniel Carnahan
Asked On September 9, 2009 11:06 AM

The problem I have is I am opening an existing pdf document, getting the 1st page, and writing some text on it using page.drawstring. Then I save the document. When I open the document in adobe reader, I don't see any text.

When I pick the "Select Text" tool, and choose "Select All", and then choose copy/paste into notepad, I see all my written text.

The only thing I can guess is that the text is written behind everything, is that possible? And how would I bring the text to the front if that's the case? I've tried using all sorts of coordinates to make sure that the text is written on the page, everything from (1,1) to (1100,1100).

I have done this numerous times in the past with no problems, but using a different pdf document. I am using the same code that I've used for the other 20 documents that I have done this with. Any ideas?

Jason Smith
Replied On September 11, 2009 01:24 PM

How are you drawing the text. This type of code is working for me:

PdfLoadedDocument doc = new PdfLoadedDocument(@"C:\test.pdf");
PdfPageBase page = doc.Pages[0];
PdfGraphics graphics = page.Graphics;
PdfTextElement text = new PdfTextElement();

text.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 16, PdfFontStyle.Bold);
text.Text = "Hello World!";
text.Draw(graphics, 100.0f, 100.0f);

doc.Save(@"C:\testresult.pdf");

Thiruvenkadam E [Syncfusion]
Replied On September 15, 2009 07:40 AM

Hi Daniel,

Thank you for your interest in Syncfusion products.

Draw text on exiting pdf document

We can able to draw a text on a existing pdf document by using the "public void DrawString(string s, PdfFont font, PdfBrush brush, RectangleF layoutRectangle, PdfStringFormat format)" method.

Could you please find the sample from the below location and let me know if this helps.

http://files.syncfusion.com/support/Pdf.Windows/F89879/Text.zip

Please have a look at the above sample and if still the issue exists,

Could you please try to reproducing it in the above sample or send us few documents so that we could sort out the cause of the issue and provide you a solution?

Please let us know if you need any further information.

Regards,
Thiru

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;