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.

Wed Oct 27, 2021 7:45 am

The unicode char 8239 (NARROW NO-BREAK SPACE' (U+202F)) is not correctly showed when converting to PDF (unknow white square showed instead).

Using Spire.Office for JAVA 4.10.5

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Wed Oct 27, 2021 8:55 am

Hello,

Thank you for your inquiry.
In order to help us investigate your issue quickly and effectively, please provide your input file (which can reproduce your issue). You could attach it here and send it to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Sun Nov 07, 2021 2:35 pm

this.currencyFormater = NumberFormat.getCurrencyInstance(Locale.FRANCE);
String v = format.format("100000");

// And append 'v' value into a word document generated in PDF.

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Mon Nov 08, 2021 8:46 am

Hello,

Thank you for your feedback.
I tested your code, the "V" value of the result file was incorrectly displayed as "100Â" at my side, but it was not the white square. To help us have a further test, could you help to share us with your system information, such as OS info (E.g. Win7, 64-bit, RAM:8GB) and region setting (E.g. China, Chinese).
Meanwhile, I have logged the incorrect display issue into our bug tracking system with the ticket number SPIREPDF-4773. Our development team will investigate the caused reason. Once there is any update, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Mon Nov 15, 2021 7:35 am

Hello,

Thanks for your patience.
Glad to inform you that the issue SPIREPDF-4773 has been resolved. Please use the code below to test. Looking forward to your test feedback.
Code: Select all
        PdfDocument pdf = new PdfDocument();
        PdfPageBase page = pdf.getPages().add();
        NumberFormat currencyFormater = NumberFormat.getCurrencyInstance(Locale.FRANCE);
        String v = currencyFormater.format(100000);
        PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", Font. PLAIN, 14),true);
        PdfSolidBrush brush = new PdfSolidBrush(new PdfRGBColor(Color.red));
        page.getCanvas(). drawString(v, font, brush, 0, 100);
        pdf.saveToFile("output.docx", FileFormat.DOCX);

Sincerely,
Annika
E-iceblue support team
User avatar

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

Mon Nov 15, 2021 8:52 pm

Hi,

Could you tell me in which version of Spire.Office for Java it will be delivered ?

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Tue Nov 16, 2021 1:39 am

Hi,

Thank you for your feedback.
The issue SPIREPDF-4773 has no repaired version, only some codes have been modified. Please use Spire.Office for Java Version: 4.10.5 for testing.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Tue Nov 16, 2021 8:10 pm

Sorry but the code proposed is not efficient in our case.

We convert PDF from Word Office format exported as PDF.
So the code is not generated by hand.

QuentinSup
 
Posts: 46
Joined: Mon Oct 18, 2021 9:18 am

Wed Nov 17, 2021 5:32 am

Hello,

Thank you for your feedback.
I simulated a word file containing the unicode char 8239 characters and converted it to PDF. There is no problem with the content of the PDF file, and did not reproduce your issue. I've attached my input file (input.docx) and the result file (output.pdf).
Code: Select all
Document document = new Document();
document.loadFromFile("input.docx");
document.saveToFile("output.pdf", FileFormat.PDF);

In addition, I also tested using our product to create a word file containing the unicode char 8239 characters and then converted it to a PDF file, but still did not reproduce your issue. The test code is as follows.
Code: Select all
Document doc = new Document();
Section section = doc.addSection();
Paragraph paragraph = section.addParagraph();
NumberFormat currencyFormater = NumberFormat.getCurrencyInstance(Locale.FRANCE);
String v = currencyFormater.format(100000);
TextRange textRange = paragraph.appendText(v);
textRange.getCharacterFormat().setFontName("Arial");
textRange.getCharacterFormat().setFontSize(14);
textRange.getCharacterFormat().setTextColor(Color.black);
doc.saveToFile("result.pdf",FileFormat.PDF);

Please try the second method. If the issue still exists after trying, please provide the following information for our reference. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your sample Word file.
2) All test codes related to our products.
3) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
4) Your JDK version, such as 1.8.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.PDF