|113819||Oct 10,2013 03:37 PM UTC||Oct 18,2013 04:26 AM UTC||ASP.NET Web Forms (Classic)||1|
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();
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.
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.
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.