Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon May 17, 2021 7:45 am

I use Spire.doc in my Java application for filling some Word form fields in documents.

When I try to physically print out my just created document, unfortunately the content of the document lost some content on the right side/border (about 5 %), the document are cutted on right side/border.

If I save the document as a doc. file and print it manually with Word, the document will be printed correctly and fully.

The Java code is created with this tutorial: Tutorials/Java/Spire.Doc-for-Java/Program-Guide/Print/Print-Word-Document-in-Java.html

I tried to make some changes on the setImagableArea method, but I can’t fix this problem. I also tried to make changes on the paper.setSize() method, but without success.

Is where someone with the same issue?

One other workaround is to scale down the document to 5%, but I didn’t find any way to scale down a document.

BTW to the form fields: Is there any way to set the “Default text” of a Word form field? When I open the document in Word, the default text field is always filled with many blanks. I didn't find any method for Java, only for .net.

Haushaus
 
Posts: 3
Joined: Mon Aug 24, 2020 8:44 am

Mon May 17, 2021 10:34 am

Hello,

Thanks for your inquiry.
Regarding the issue of missing content in printed documents, please provide your input file for further investigation. You could send it to us(support@e-iceblue.com) via email. Thanks in advance.
Besides, you can refer to the following code to set the default text of a Word form field.
Code: Select all
        Document document = new Document();
        Section section = document.addSection();
        Paragraph paragraph = section.addParagraph();
        TextFormField field = (TextFormField) paragraph.appendField("formFild", FieldType.Field_Form_Text_Input);
        field.setText("Default text");
        document.saveToFile("javamaven/src/main/resources/Sample.doc",FileFormat.Doc);

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri May 21, 2021 7:42 am

Hello,

How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc