Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Nov 05, 2024 6:53 am

--------------------------------------------
※The version of the product you are using
:Spire.XLS for Java(Version:14.11.0)

※OS info
:Windows 10, 64-bit region setting (japan, japanese).

※application type
:JDK1.8
--------------------------------------------
Hello.

I'm converting an xls document to PDF, but when I add a setting to display the Japanese calendar in the row of a cell I'm using and convert it to PDF, the output date is completely different.

Is there a way to solve this?

The source code and cell settings are as follows:
Code: Select all
import com.spire.xls.FileFormat;
import com.spire.xls.Workbook;

public class sample {

    public static void main(String[] args) {

        //Workbook_Instance
        Workbook workbook = new Workbook();
        //Excel_lord
        workbook.loadFromFile("Support.xls");

        //PDFsize
        workbook.getConverterSetting().setSheetFitToPage(true);

        //saveDocument
        workbook.saveToFile("output/Support.pdf", FileFormat.PDF);
    }
}


.xls CellSettings
Code: Select all
"format Cells"→"custom"→"TYPE":[$-ja-JP]ge.m.d
Attachments
xls_convert.zip
xls's File
(120.8 KiB) Downloaded 14 times
xls_ConvertTo_PDF.png
convertPDF
xls_ConvertTo_PDF.png (131.12 KiB) Viewed 16 times

reiji898
 
Posts: 1
Joined: Tue Nov 05, 2024 4:32 am

Tue Nov 05, 2024 9:41 am

Hi,

Thank you for your message.
I suggest you try again after adding this line of code before the conversion. If you still encounter issues, please feel free to contact us again.

Locale.setDefault(Locale.JAPANESE);

Sincerely,
Doris
E-iceblue support team
User avatar

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

Return to Spire.XLS