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 Feb 19, 2024 3:04 pm

Hello. I have a problem with displaying square character ☐ and space after it, when generating PDF from DOCX.
Space looks like it dissapeared and the following text is too close to the square character. See attached files.
I am using spire.doc for Java, maven dependency of version 5.4.10.
The code below runs thru spring on SAP NetWeaver Application Server 7.21 / AS Java 7.30.3710.251566.20121218150943.
Thanks for help in advance.

Code: Select all
   public byte[] docxToPdf(byte[] docx) {
      LOGGER.debug("Converter start.");
      
      Document document = new Document(new ByteArrayInputStream(docx));
      
      ToPdfParameterList params = new ToPdfParameterList();
      initFonts();
      params.setPrivateFontPaths(fonts);
      document.setEmbedFontsInFile(true);
      
      byte[] fileBytes = null;
      ByteArrayOutputStream fileStream = null;
      try {
         fileStream = new ByteArrayOutputStream();
         document.saveToStream(fileStream, params);
         fileBytes = fileStream.toByteArray();
         LOGGER.debug("Converter done. Size: {}", fileBytes.length);
      } catch (Exception e) {
         LOGGER.debug("Converter failed. ", e);
      } finally {
         if (fileStream != null) {
            try {
               fileStream.close();
            } catch (IOException e) {
               LOGGER.error("", e);
            }
         }
      }
      
      return fileBytes;
   }

filipsuch
 
Posts: 2
Joined: Mon Feb 19, 2024 2:00 pm

Tue Feb 20, 2024 6:09 am

Hello,

Thank you for your inquiry.
Unfortunately, we currently do not have an existing SAP NetWeaver Application Server environment available for testing purposes. I have conducted preliminary testing on Windows, but have not been able to reproduce the issue you mentioned. Based on the information provided, it appears that the version of Spire.Doc you are using is quite outdated, dating back to two years ago. Therefore, I recommend upgrading to our latest commercial version (Spire.Doc for Java Version: 12.1.16) for testing purposes.

Furthermore, I will continue to investigate the details of the environment you are utilizing to better understand the issue at hand.
Thank you for your understanding and cooperation.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1652
Joined: Wed Apr 07, 2021 2:50 am

Tue Feb 20, 2024 9:23 am

Thank you for your response. Version 12.1.16 worked for displaying squares and spaces.
I just want to ask about some other smaller issues. See attached files with picture of comparing differences.
One word at the end of the line was generated to the beginning of next line.
Also, color of page number turned from gray to black.
Thank you again.

filipsuch
 
Posts: 2
Joined: Mon Feb 19, 2024 2:00 pm

Tue Feb 20, 2024 9:55 am

Hello,

Thank you for your feedback.
I have tested the file you provided and was able to replicate the issue you mentioned. However, upon further investigation, I found that when converting your document to a PDF using Microsoft Word, the result matches the output from our Spire.Doc conversion. Please note that we adhere to Microsoft Word's standards, and as such, we will not be addressing the issue you raised. Thank you for your understanding.
If you have any more questions or need further assistance, please feel free to reach out.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1652
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc

cron