Record extraction to PDF

Hi all,

Is there an easy way to generate a PDF from a record, for example, while displaying a record then using a related action a pdf could be generated which later can be printed.

Thank you.

OriginalPostID-257250

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    @Vasiling You could use iText API to create a pdf file in java and use Apache POI to access the data in the MS-EXCEL file. If you combine both, you could convert your excel file.

    => So you can combine iText and Apache POI API together while creating the Smart Service

    The required parameters could be:

    1. existingExcelFile (Type: File)
    2. replaceExisting (Type: Boolean)
    3. saveInto (Type: Folder)


    whereas the output can be the generated document

    Alternatively You can try AsposeCells for Java which allows you to convert Excel file to PDF in Java applications while building Smart Service for Excel to PDF

    Now coming to code snippet for AsposeCells in java, you can do something as follow:-
    =======================================================================
    //Instantiate a new workbook with excel file path
    Workbook workbook = new Workbook("F:\\\\FileTemp\\\\Book1.xls"); //here you could refer KC Document i.e. existingExcelFile input

    //Save the document in Pdf format
    workbook.save("F:\\\\FileTemp\\\\MyPdfFile.pdf", FileFormatType.PDF); //Here you could refers saveInto
    ======================================================================

    Hope this will help you to take a initiative in order to build a Smart Service to convert Dynamically Generated Excel to PDF

    Thanks
Reply
  • 0
    Certified Lead Developer
    @Vasiling You could use iText API to create a pdf file in java and use Apache POI to access the data in the MS-EXCEL file. If you combine both, you could convert your excel file.

    => So you can combine iText and Apache POI API together while creating the Smart Service

    The required parameters could be:

    1. existingExcelFile (Type: File)
    2. replaceExisting (Type: Boolean)
    3. saveInto (Type: Folder)


    whereas the output can be the generated document

    Alternatively You can try AsposeCells for Java which allows you to convert Excel file to PDF in Java applications while building Smart Service for Excel to PDF

    Now coming to code snippet for AsposeCells in java, you can do something as follow:-
    =======================================================================
    //Instantiate a new workbook with excel file path
    Workbook workbook = new Workbook("F:\\\\FileTemp\\\\Book1.xls"); //here you could refer KC Document i.e. existingExcelFile input

    //Save the document in Pdf format
    workbook.save("F:\\\\FileTemp\\\\MyPdfFile.pdf", FileFormatType.PDF); //Here you could refers saveInto
    ======================================================================

    Hope this will help you to take a initiative in order to build a Smart Service to convert Dynamically Generated Excel to PDF

    Thanks
Children
No Data