We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF document does not finish converting to format 2U

The attached Excel document was first converted to PDF:

            // Open the template excel file
            Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(inputPath);

            // create explicit SaveOptions
            Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
            pdfSaveOptions.OnePagePerSheet = true;
            pdfSaveOptions.AllColumnsInOnePagePerSheet = true;
            pdfSaveOptions.ExportDocumentStructure = true;
            pdfSaveOptions.GridlineType = GridlineType.Hair;

            foreach (Worksheet worksheet in wb.Worksheets)
                worksheet.PageSetup.PrintGridlines = false;

            // Save the pdf file.
            wb.Save(outputPath, pdfSaveOptions);

That seems to work OK, see the attached .pdf file. After that I tried to convert the PDF to the 2U pdf format (listBoxFormat.SelectedItem):

            // open input Pdf
            Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(inputPath);

            // Convert to different PDF compliant document
            // During conversion process, the validation is also performed
            PdfFormat myPdfFormat;
            if (Enum.TryParse(listBoxFormat.SelectedItem.ToString(), out myPdfFormat))
                uint value = (uint)myPdfFormat;
            else { /* error: the string was not an enum member */ }
            string logFile = Path.GetFileNameWithoutExtension(inputPath) + "-log.xml";
            pdfDocument.Convert(Path.Combine(_outDir, logFile), myPdfFormat, ConvertErrorAction.Delete);

            // Save output document

After waiting for more than 5 minutes, the Save still hasn’t finished, so I have to assume there is an inifinite loop. Can you help here? I’m using Aspose libraries 22.2.

docs.zip (7.8 MB)


The output PDF is Ok by Aspose.Cells as you mentioned. The issue seems to be on Aspose.PDF end, so I am moving your thread to respective forum where one of our fellow colleagues from Aspose.PDF team will evaluate your issue soon.


We were able to notice the issue while testing the scenario using Aspose.PDF for .NET 22.3. Therefore, it has been logged as PDFNET-51704 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.