Hi I want to convert xlsx file to pcl using aspose.cells and C#. Please help.
@amitabha83
At present, we do not support xlsx to pcl conversion. Would you like to provide a sample file and the expected result file? This will be very helpful for us to study and implement the new features.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-56242
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
As discussed I am attaching an sample excel file and I want to convert to pcl.Here what i have done
I have converted the xslx file to pdf then convert the pdf to pcl(OriginalExcel–>ExcelConvertToPdf–>ExcelDoc–>ExcelPclSample) But one extra pcl page is coming with junk character,
Same thing happens from pdf to pcl conversion(OriginalPdf–>PDFDoc–>PdfPclSample)
I have used the following code
----Save pdf file or excel file in pdf format using aspose cells-----
private void SaveByteArrayToFile(byte[] byteArray, string filepath, string filetype, string blNo, string filename, int filecount,ReportGenerationContext context)
{
filename = Path.GetFileNameWithoutExtension(filename);
filename = blNo + “Attach” + filecount + “_” + filename;
if (filetype == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
string exceFilePath = filepath + "\\" + filename;
File.WriteAllBytes(exceFilePath, byteArray);
Workbook workbook = new Workbook(exceFilePath);
string excelpdffilepath = Path.Combine(filepath, filename + ".pdf");
// Save the Excel file as PDF
workbook.Save(excelpdffilepath, Aspose.Cells.SaveFormat.Pdf);
}
else
{
string pdfFilePath = filepath + "\\" + filename +".pdf";
context.Log.Verbose("Pdf file path:{0}",pdfFilePath);
File.WriteAllBytes(pdfFilePath, byteArray);
}
}
-----Converting PDF to pcl------
private void CreatePclFromPdf(string[] pdfFilePaths, string blNo, string outputDirectory, ReportGenerationContext context)
{
foreach (string pdfFilePath in pdfFilePaths)
{
string filename = Path.GetFileNameWithoutExtension(pdfFilePath);
string pclFilePath = Path.Combine(outputDirectory, blNo+ "_" +filename + ".pcl");
string docFilePath= Path.Combine(outputDirectory, filename + ".doc");
Aspose.Words.Document document = new Aspose.Words.Document(pdfFilePath);
// save PDF as a DOC
document.Save(docFilePath, Aspose.Words.SaveFormat.Doc);
// load Doc with an instance of Document
string docfilename = Path.GetFileNameWithoutExtension(docFilePath);
var outputDocument = new Aspose.Words.Document(docFilePath);
// call save method while passing SaveFormat.Pcl
outputDocument.Save(pclFilePath, Aspose.Words.SaveFormat.Pcl);
}
}
Please note that original pdf/Excel file and the generated doc file is perfect but the final pcl file is not correct since it adds one more page with some junk text in different language which is not present anywhere in the original document.
Please co operate its urgent. We are using Aspose paid license.
I am attaching all the files as Documents.
Documents.zip (128.7 KB)
As you are performing the conversion in two steps: first from Excel to PDF using Aspose.Cells, and then from PDF to PCL using Aspose.Words, it appears that your issue lies with the Aspose.Words API, as the generated PDF file from the source Excel file (first step) appears to be fine. We suggest that you also kindly post your issue with the resource files in the Aspose.Words forum, and one of our colleagues from the Aspose.Words team will evaluate your issue and resolve it soon.
In the meantime, we will evaluate the direct Excel to PCL conversion feature (we have already logged a ticket “CELLSNET-56242” for it) to see if we can support it.
I have already raised the issue to the Aspose.words support team
Is there any update? We are stuck and its a blocker issue. Please cooperate asap.
I am sorry, but there is no update at the moment. It will be addressed in due course. Once we have an update on it, we will let you know here.
Please note that we can only raise the priority of an issue to a certain extent in our normal (free) support model, where tickets are prioritized on a first come, first served basis. For urgent resolutions of issues, we recommend using our priority support model, where issues are given the highest priority and are resolved urgently.
Then, please login with your Priority Support account on the priority support helpdesk and log a ticket/thread (refer to the existing ticket here) there.
Saving xlsx to pcl directly is initially supported, please check the output pcl file:
ExcelConvertToPcl_preview.zip (3.2 KB)
Workbook wb = new Workbook("OriginalExcel.xlsx");
wb.Save("ExcelConvertToPcl.pcl", SaveFormat.Pcl);
We plan to support this feature in 24.11(coming release), please let us know your feedback.
The issues you have found earlier (filed as CELLSNET-56242) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi