Hello, we are having some issues when printing/rendering our Excel documents.
Basically we are not recieving the desired output (as desried from the the original document) and was hoping you could assist in shedding some light on a possible problem. I have attached the original XLS file, as well as the “out” file of the worksheet parsed through Aspose.Cells as well as when saving the file to a PDF.
What you will notice (hopefully, check the line “AN H&P UPDATE PERFORMED IMMEDIATELY PRIOR TO SURGERY/PROCEDURE MUST BE ON THE MEDICAL RECORD.”) is that the text formatting is not consistent from the original document and squishes. Also, when printing directly to a printer the margins are off.
I tried to simulate that output as direct-MIH - MIH OP HP.out.xls.pdf which was printed with the below code using PdfFactory as the printer. (Please note that this is the same result that we receive on our actual printer, a Samsung laser printer.)
I am using the Aspose.Cells 7.2.2.1 with the following basic code:
var workbook = new Workbook(targetFile);
...
var ranges = workbook.Worksheets.GetNamedRanges(); if (ranges.Length > 0) { //commented out code for testing purposes
//foreach(var range in ranges) {
// var cell = range.GetCellOrNull(range.RowCount - 1, range.ColumnCount - 1) ?? range[0, 0];
// cell.PutValue(value);
//}
workbook.CalculateFormula(true); var newPath = Path.Combine(targetFilePath, string.Format("{0}.out{1}", simpleFileName, targetFileExt)); if (isPdf) { workbook.Save(newPath, new PdfSaveOptions( SaveFormat.Pdf)); } else { worksheet.IsPageBreakPreview = true; var options = new ImageOrPrintOptions { OnePagePerSheet = false, PrintingPage = PrintingPageType.Default }; var sr = new SheetRender(worksheet, options); sr.ToPrinter(printerName); } //end if isPdf } //end if ranges.Length > 0