Re: Pdf for Java - Exception

Hello Friends,
I got an error in pdf.bindXML and pdf.save. Will you please help me.. And I have displayed my code below.
package Please;
import java.io.*;
import java.lang.*;
import com.aspose.cells.*;
import aspose.pdf.*;
public class Pdf {
public static void main(String[] args) throws Exception
{
Workbook workbook = new Workbook();
workbook.save("D:\\anu\\Project\\Book1.xml", FileFormatType.ASPOSE_PDF);
Pdf pdf = new Pdf();
pdf.bindXML("D:\\anu\\Project\\Book1.xml", null);
pdf.save("D:\\anu\\Project\\Book1.pdf");
}
}

Anu Satveeha:
Hello Friends,
I got an error in pdf.bindXML and pdf.save. Will you please help me.. And I have displayed my code below.
package Please;
import java.io.*;
import java.lang.*;
import com.aspose.cells.*;
import aspose.pdf.*;
public class Pdf {
public static void main(String[] args) throws Exception
{
Workbook workbook = new Workbook();
workbook.save("D:\\anu\\Project\\Book1.xml", FileFormatType.ASPOSE_PDF);
Pdf pdf = new Pdf();
pdf.bindXML("D:\\anu\\Project\\Book1.xml", null);
pdf.save("D:\\anu\\Project\\Book1.pdf");
}
}

Hi Anu,

Thanks for contacting support.

As per my understanding, you are trying to convert MS Excel file to PDF format and you are using a legacy approach of converting MS Excel contents to XML format using Aspose.Cells and then transforming XML file contents to PDF format using Aspose.Pdf for Java.

Please note that this approach for conversion is obsolete and now you can directly convert Excel workbooks to PDF format using Aspose.Cells for Java without using Aspose.Pdf for Java. For further details, please visit Converting Excel to PDF Files.