how to convert pdf files to xml or .xlsx or .csv using php script
Hi there,
Hi,
Hi there,
Thanks for your patience. Please check the following code snippet for converting PDF to Excel using PHP via COM Interop. You may use MobiXML enum value, 8, for saving PDF to XML.
Please check the following documentation links for using Aspose.Pdf for .NET via COM. It is recommended to use a Wrapper for working directly with Aspose.Pdf for .NET; you can create your own wrappers for your needs.
<?php
echo "<h2>Calling Aspose.Pdf for .NET from PHP using COM Interoperability</h2>";
echo "<h3>PDF to Excel Conversion</h3>";
// set license
$lic = new COM("Aspose.Pdf.License");
$lic->SetLicense("C:/temp/Aspose.Total.lic");
// Load Pdf Document
$input = "C:/temp/HelloWorld.pdf";
$helper = new COM("Aspose.Pdf.ComHelper");
$pdf = $helper->OpenFile($input);
// Save the PDF document to desired file format by passing SaveFormat enum value for the format.
$output = "C:/temp/test_php.xls";
$pdf->Save_4($output, 9);
?>
Please feel free to contact us for any further assistance.
Best Regards,
Hi,
Thank you for your reply.I got some doubts.
i)
$lic = new COM(“Aspose.Pdf.License”);
$lic->SetLicense("C:/temp/Aspose.Total.lic");
Where can i get the files "Aspose.Total.lic" and from which file I have to create the object "Aspose.Pdf.License".
ii) $pdf->Save_4($output,9);
What is "9" in the above code.
iii) can we use this code to convert the pdf file into csv.
Hi there,
We would like to share with you that Aspose.PDF for .NET 20.7 now offers a feature to convert PDF to CSV directly by specifying saving format. Please consider using following code snippet:
ExcelSaveOptions options = new ExcelSaveOptions();
options.ConversionEngine = ExcelSaveOptions.ConversionEngines.NewEngine;
options.Format = ExcelSaveOptions.ExcelFormat.CSV;
Document pdfDocument = new Document("Currencies.pdf");
pdfDocument.Save("Currencies.csv", options);