Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Aug 31, 2018 11:37 am

Hello Team,
doc.Print() function is not printing the image within the pdf file.

nagtilaklaxman
 
Posts: 3
Joined: Thu Jul 19, 2018 1:03 pm

Mon Sep 03, 2018 6:57 am

Hi nagtilaklaxman,

Thanks for your inquiry. I have also received the related details via email.
After testing, I didn’t encounter the issue you mentioned and have confirmed that the printed PDF document with the latest Spire.PDF version(Spire.PDF Pack(Hot Fix) Version:4.8.14)  contains the complete image. Below is my code for your kind reference.
Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile("TestFormTemplate.pdf");
PdfFormWidget formWidget = pdf.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;
        switch (textBoxField.Name)
        {
            case "FirstName":
                textBoxField.Text = "Laxman";
                textBoxField.BackColor = Color.Red;
                break;
            case "LastName":
                textBoxField.BackColor = Color.Red;
                var Brush = new PdfSolidBrush(Color.Red);
                textBoxField.Page.Canvas.DrawRectangle(Brush, new RectangleF(textBoxField.Location, textBoxField.Size));
                break;
        }
    }
}
pdf.Print();

 
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Return to Spire.PDF