Thanks for the reply Ingo.
We are using licensed version of 11.15. We are facing different kind of issues here. We are printing tickets and saving respective PDF files using QuickPDF.
1. Prints randomly will come out blank and if you print the same ticket again, it will print fine. Here is the code snippet..
PDFLibrary quickPdf = _objQuickPdf as PDFLibrary; int result = quickPdf.LoadFromString(data, null); - Data here is a UTF-8 byte stream if (result != 1) { //Log statement } if (quickPdf.NewPage() == 0) { Log("The page could not be added"); } int captureID = quickPdf.CapturePage(1); if (captureID == 0) { Log("QuickPDF: The specified page does not exist, or it is the only page in the document"); } if (quickPdf.SetOrigin(1) != 1) { Log("QuickPDF: Failed to set origin for the new page"); } quickPdf.SetMeasurementUnits(1); if (pageScaling.ToUpper() == "TRUE") { double scaleFactor = scalePercentage; double horizBorder = width * (1.0 - scaleFactor) / 2; double vertBorder = height * (1.0 - scaleFactor) / 2; if (quickPdf.DrawCapturedPage(captureID, horizBorder, vertBorder, width - 2 * horizBorder, height - 2 * vertBorder) == 0) { Log("QuickPDF: An invalid CaptureID was specified"); } } else { if (quickPdf.DrawCapturedPage(captureID, xPosition, yPosition, width, height) == 0) { Log("QuickPDF: An invalid CaptureID was specified"); } } int iPrintOptions = quickPdf.PrintOptions(0, 0, ticketName); int printreturnvalue = quickPdf.PrintDocument(PrinterName, 1, 1, iPrintOptions);
2. Sometimes hardcopy prints are coming fine but the respective PDF on hardrive is being saved as blank PDF or misprinted PDF(only half of ticket content is there on PDF). Interesting thing here is that when you copy the byte stream in a text file and save it as .pdf file, PDF will look fine but when you save the same through application using quickPDF.Savetofile(), it will save pdf as blank or misprinted although the hardcopy print will be fine.
3. Sometimes we have seen that quickpdf.Printtodocument() will throw exception and we will see following in our log file "Exception writing PDF document. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception." What can be the reason for this?
4. Sometimes quickpdf.LoadFromString() is not able to load a document and it does not return 1. What can be the reason for this?
Any help will really help us in tracking down the issue.
|