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.

Thu Aug 08, 2024 12:49 am

Hello.
I wrote a sample code that converts word documents into PDFs with the latest version (12.7.17)
In PDF, Korean_Digital, Korean_Legal, and Korean_CountingListPatternType all change to 1,2,3..Arabian numerals.
How can I mark it in Korean?
I've also added the sample code I've written.


Code: Select all
        //Create a Document object
        Document document = new Document();
        Document.setGlobalCustomFontsFolders("C:\\ws\\wordtohtml\\fonts");
        document.setEmbedSystemFonts(true);
        document.setEmbedFontsInFile(true);
        document.setKeepSameFormat(true);

        PrivateFontPath fontPath1 = new PrivateFontPath();
        fontPath1.setFontName("맑은 고딕");
        fontPath1.setFontPath("C:\\ws\\wordtohtml\\fonts\\malgun.ttf");
        document.getPrivateFontList().add(fontPath1);

        //Add a section
        Section section = document.addSection();

        //Create a numbered list style
        ListStyle listStyle = new ListStyle(document, ListType.Numbered);
        listStyle.setName("numberedList");
        document.getListStyles().add(listStyle);

        //Add a paragraph
        Paragraph paragraph = section.addParagraph();
        paragraph.appendText("Required Web Development Skills:");
        paragraph.getFormat().setAfterSpacing(5);

        //Add a paragraph and apply the numbered list style to it
        paragraph = section.addParagraph();
        paragraph.appendText("HTML");
        paragraph.getListFormat().applyStyle("numberedList");
        paragraph.getListFormat().setListLevelNumber(0);

        //Add another four paragraphs and apply the numbered list style to them
        paragraph = section.addParagraph();
        paragraph.appendText("CSS");
        paragraph.getListFormat().applyStyle("numberedList");
        paragraph.getListFormat().setListLevelNumber(0);

        paragraph = section.addParagraph();
        paragraph.appendText("JavaScript");
        paragraph.getListFormat().applyStyle("numberedList");
        paragraph.getListFormat().setListLevelNumber(0);

        paragraph = section.addParagraph();
        paragraph.appendText("MySQL");
        paragraph.getListFormat().applyStyle("numberedList");
        paragraph.getListFormat().setListLevelNumber(0);
        paragraph.getStyle().getCharacterFormat().setFontName("맑은 고딕");
//        paragraph.get.getCharacterFormat().setFontName("Arial Black");

        paragraph.getListFormat().getCurrentListLevel().setPatternType(ListPatternType.Korean_Counting);
        paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setAfterSpacing(50);
        paragraph.getListFormat().getCurrentListLevel().getCharacterFormat().setFontName("맑은 고딕");
        paragraph.getListFormat().getCurrentListLevel().getCharacterFormat().setFontSize(20);

        paragraph.getStyle().getCharacterFormat().setFontName("맑은 고딕");

        //Save the document to file
        document.saveToFile("output/NumberedList.docx");

        ArrayList<PrivateFontPath> fontPathList = new ArrayList<>();
        fontPathList.add(fontPath1);

        ToPdfParameterList ppl = new ToPdfParameterList();
//        ppl.isEmbeddedAllFonts(true);
//        ppl.setEmbeddedFontNameList(fontNameList);
//        ppl.setUsePSCoversion(true);
//        ppl.setAutoFitTableLayout(true);
//        ppl.setMimicWPSLayout(true);
        ppl.setPrivateFontPaths(fontPathList);
        ppl.setPdfConformanceLevel(PdfConformanceLevel.Pdf_A_1_B); // https://docs.fileformat.com/ko/pdf/a/
//        ppl.setMemoryOptimization(true);

        document.saveToFile("output/NumberedList.pdf", ppl);

MyNameIsYuna
 
Posts: 1
Joined: Thu Aug 08, 2024 12:38 am

Thu Aug 08, 2024 8:36 am

Hi,

Thank you for bringing this issue to our attention.
I reproduced your issue and logged it into our bug tracking system with number reference SPIREDOC-10749. Once the issue is resolved, we will inform you immediately. Sorry for any inconvenience caused.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.Doc

cron