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.

Tue Jan 18, 2022 8:48 pm

Hi!

I am having issues trying to compile in script in java

I am getting error like this:

t2.java:77: error: unmappable character for encoding Cp1255
finalText.appendText("╫ק╫ר╫ש╫ס╫¬ ╫?╫ש╫¬╫ץ╫¿╫?╫? ╫?╫ץ╫? ╫?╫ש╫ש╫?" );

And if it doesn’t having any Hebrew words its gives me this

symbol: class Paragraph
location: class table
table.java:43: error: cannot find symbol
document.saveToFile("tableTest.docx", FileFormat.Docx);


Thanks for helping!

wedew222
 
Posts: 8
Joined: Mon Jan 17, 2022 4:01 pm

Wed Jan 19, 2022 5:46 am

Hello,

Thank you for your inquiry.
According to your description, I did an initial test, but did not reproduce the issue you mentioned (my test code is as follows). The version I used is the latest version(Spire.Doc for Java Version:5.1.9). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your input Word file (if any).
2) Your complete test code.
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 (E.g. JDK 1.8 ).
Code: Select all
        Document document = new Document();
        Section section = document.addSection();
        Table table = section.addTable(true);
        TableRow row = new TableRow(document);
        row.setHeight(50.0f);
        table.getRows().add(row);

        TableCell cell = new TableCell(document);
        Paragraph paragraph = cell.addParagraph();
        //paragraph.applyStyle(style.getName());
        paragraph.getStyle().getCharacterFormat().setFontName("Arial");
        paragraph.getStyle().getCharacterFormat().setFontSize(12f);

        paragraph.appendText("╫ק╫ר╫ש╫ס╫¬ ╫?╫ש╫¬╫ץ╫¿╫?╫? ╫?╫ץ╫? ╫?╫ש╫ש╫?");
        row.getCells().add(cell);
        document.saveToFile("result.docx",FileFormat.Docx);


Sincerely,
Annika
E-iceblue support team
User avatar

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

Wed Jan 19, 2022 6:24 am

Annika.Zhou wrote:Hello,

Thank you for your inquiry.
According to your description, I did an initial test, but did not reproduce the issue you mentioned (my test code is as follows). The version I used is the latest version(Spire.Doc for Java Version:5.1.9). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your input Word file (if any).
2) Your complete test code.
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 (E.g. JDK 1.8 ).
Code: Select all
        Document document = new Document();
        Section section = document.addSection();
        Table table = section.addTable(true);
        TableRow row = new TableRow(document);
        row.setHeight(50.0f);
        table.getRows().add(row);

        TableCell cell = new TableCell(document);
        Paragraph paragraph = cell.addParagraph();
        //paragraph.applyStyle(style.getName());
        paragraph.getStyle().getCharacterFormat().setFontName("Arial");
        paragraph.getStyle().getCharacterFormat().setFontSize(12f);

        paragraph.appendText("╫ק╫ר╫ש╫ס╫¬ ╫?╫ש╫¬╫ץ╫¿╫?╫? ╫?╫ץ╫? ╫?╫ש╫ש╫?");
        row.getCells().add(cell);
        document.saveToFile("result.docx",FileFormat.Docx);


Sincerely,
Annika
E-iceblue support team


Hi!

Thanks for helping, please check your email i send everything you requested

wedew222
 
Posts: 8
Joined: Mon Jan 17, 2022 4:01 pm

Wed Jan 19, 2022 8:28 am

Hello,

Thanks for sharing the information via email.
I tested the project you provided with IntelliJ IDEA and there was no problem with the project. Please tell us the steps when you compile your program using Script, so that we can investigate further. Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.Doc