Thanks for your feedback.
I used the hotfix to loaded the PDF(AMS - GA - Retail Installment Contract_Arbitration.pdf), and inserted the image then saved. Then reloaded the file and inserted the image into the field "Borrower_CreditInsurance_ESignatureArea", everything worked well on my side. I attached my result document via email. Also, I just loaded the file(AMS - GA - Retail Installment Contract_Arbitration_BuyerInitials.pdf) and inserted image, it also worked fine.
Here is my testing code.
- Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"AMS - GA - Retail Installment Contract_Arbitration 2.pdf");
PdfImage image1 = PdfImage.FromFile(@"F:\image\flower2.jpg");
doc.Pages[0].Canvas.DrawImage(image1, 497,753,27,18);
MemoryStream stream = new MemoryStream();
doc.SaveToStream(stream);
PdfDocument Rdoc = new PdfDocument(stream);
PdfFormWidget formWidget = Rdoc.Form as PdfFormWidget;
for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
{
PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
if (field is PdfTextBoxFieldWidget)
{
PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
if (textBoxField.Name == "Borrower_CreditInsurance_ESignatureArea")
{
PointF point = textBoxField.Location;
System.Drawing.Rectangle rect = new System.Drawing.Rectangle((int)point.X, (int)point.Y, (int)textBoxField.Size.Width, (int)textBoxField.Size.Height);
PdfImage image = PdfImage.FromFile(@"F:\image\flower2.jpg");
Rdoc.Pages[0].Canvas.DrawImage(image, rect);
}
}
}
Rdoc.SaveToFile("11685.pdf");
What is your complete code ? Could you please send the code and the related image for testing.
Sincerely,
Betsy
E-iceblue support team