Hi,
I am contacting from Siemens, and our order id is Order ID #230221225438.
I am trying to convert xml+xslt to pdf., and we are using aspose total java APIs for the same.
The conversion is taking more than an hour. Using aspose C++ API, the conversion was much faster, it was completed in 1 min. I am attaching both the code snippets and sample files.
Please help us to reduce the file generation time.
Java Code snippet:
import com.aspose.pdf.*;
import com.aspose.pdf.XslFoLoadOptions;
public class PanelAssetConversion {
public void convertPanelAsset(String xmlFile,String xsltFile, String Output) throws Exception {
com.aspose.pdf.License pdfLicense = new com.aspose.pdf.License();
pdfLicense.setLicense("Aspose.Total.Java.lic");
// Instantiate XslFoLoadOption object
System.out.println("Loading options....\n");
XslFoLoadOptions options = new XslFoLoadOptions(xsltFile);
// Create Document object
System.out.println("Providing input xml....\n");
Document pdfDocument = new com.aspose.pdf.Document(xmlFile, options);
System.out.println("Saving pdf....\n");
pdfDocument.save(Output);
pdfDocument.close();
System.out.println("Completed....\n");
}
}
C++ code snippet:
void convertPanelAsset( System::String xmlFile, System::String xsltFile, System::String pdfFile )
{
try
{
std::cout << "Generating PDF from xml...\n";
// Instantiate XslFoLoadOption object
auto options = MakeObject<Aspose::Pdf::XslFoLoadOptions>( xsltFile );
// Create Document object
auto pdfDocument = MakeObject<Aspose::Pdf::Document>( xmlFile, options );
pdfDocument->Save( pdfFile );
}
catch ( System::Exception ex )
{
std::cerr << ex.what();
throw;
}
}
PanelAsset.zip (5.6 KB)
Regards,
Jancirani C