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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can we insert an image into an existing pdf that was recently created via doc to pdf converter

Thread ID:





113819 Oct 10,2013 03:37 PM UTC Oct 18,2013 04:26 AM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
Jeff O''Connell
Asked On October 10, 2013 03:37 PM UTC

Do you have a sample that shows how to Insert an image in an existing pdf that was converted from word Doc originally.  Here's the code that I'm using to convert the word doc.

string ext = Path.GetExtension(file.Name).ToLower();
 FileStream FS;
 if (ext == ".doc" || ext == ".docx")
 string strFullFileName = strPath + file.Name; 
 FS = File.OpenRead(strFullFileName);
 Stream readFile = FS;               

 WordDocument wordDoc = null;
 // check the word extension type
 if (ext == ".doc")
     wordDoc = new WordDocument(readFile, Syncfusion.DocIO.FormatType.Doc);
 else if (ext == ".docx")
     wordDoc = new WordDocument(readFile, Syncfusion.DocIO.FormatType.Docx);
 DocToPDFConverter converter = new DocToPDFConverter();
 //Convert word document into PDF document
 PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);
Could I insert the image here using pdfDoc or is that something that needs after I save the file (see below)

 // set password for security and view preferences
 pdfDoc.ViewerPreferences.FitWindow = true;
 pdfDoc.Security.OwnerPassword = "blahblahblah";

 //pdfDoc.Security.Permissions = Syncfusion.Pdf.Security.PdfPermissionsFlags.Print;
 pdfDoc.ViewerPreferences.PageLayout = PdfPageLayout.TwoPageLeft;
 NewFileName = NewFileName + ".pdf";
 //pdfDoc.Save(NewFileName, Response, HttpReadType.Save);
 pdfDoc.Save(strSavedFileLocation + NewFileName);
Or do I need to retrieve and load the new .pdf I just saved in the location in the line above (pdfDoc.Save) here.


What I need to do is add/insert our logo 215px x 52px in the upper right hand corner of the first page.

 Any assistance would be greatly appreciated.


Praveenkumar H [Syncfusion]
Replied On October 18, 2013 04:26 AM UTC

Hi Jeff,

Thank you for using Syncfusion products,

We have created the sample to insert the image into pdf document as per your requirement.

The sample is attached for your reference.


We can create the PdfImage as follow.

PdfImage image = PdfImage.FromFile(Server.MapPath('Data/logo.png'));

We can place the image into page as follow.

page.Graphics.DrawImage(image, pageWidth - 215, 0, 215, 52);

Please let us know if you need further assistance.

With Regards,




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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon