Converting Doc to PDF does not break a table row across the page

Language:
C#

Libraries:
Aspose.PDF - 8.2.0
Aspose.Words - 14.12.0

When converting a Docx file to PDF we are seeing that a row within a table is not breaking correctly across a page. Opening up the document within Microsoft Word and checking that the row is correctly marked to break across page, the checkbox is checked.

image.png (18.1 KB)

Below is the code that we are using to get the original document and then convert to a PDF:

if (docType == "pdf")
{
    System.IO.MemoryStream pdfOoutStream = new System.IO.MemoryStream();
                
    Document pdfDoc = doc.Clone();
                
    PdfSaveOptions saveOptions = new PdfSaveOptions
    {
        EmbedFullFonts = false,
        FontEmbeddingMode = PdfFontEmbeddingMode.EmbedAll,
        SaveFormat = SaveFormat.Pdf
    };

    doc = null;

    pdfDoc.Save(pdfOoutStream, saveOptions);

    System.IO.MemoryStream conversionStream = new System.IO.MemoryStream();

    Aspose.Pdf.Document pdfConvertedDocument = new Aspose.Pdf.Document(pdfOoutStream);
    
  pdfConvertedDocument.Convert(conversionStream, 
     DocumentHelper.GetPdfOutputVersion(pdfVersion), Aspose.Pdf.ConvertErrorAction.Delete);

    pdfOoutStream = new System.IO.MemoryStream();
    pdfDocument.Save(pdfOoutStream);

The function DocumentHelper.GetPdfOutputVersion(pdfVersion) retrieves the type of PDF document from the enum Aspose.Pdf.PdfFormat.

Could you please provide some feedback as to how it would be able to force tables to break across the page when converting to a PDF?

@jrubright,

Have you tried the latest version of Aspose.Words for .NET i.e. 19.8 on your end? In case the problem still remains, please ZIP and upload your input Word document and Aspose.Words generated PDF file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

@awais.hafeez We have tried upgrading and that resolves the PDF issue, but it introduces multiple formatting and spacing issues within the Word side of the document processing. I will need to get clearance before I can upload the files.

@jrubright,

We will wait for your Word/PDF documents to be able to reproduce the same problems on our end. Please also provide a comparison screenshot highlighting the problematic areas in Aspose.Words generated PDF file with respect to Word file and attach it here for our reference. Please point out the exact problematic places for this issue. We will then investigate the issue on our end and provide you more information.

I lead the support team for this application. We currently produce as many as 100K Word and PDF documents in a single day. Those documents utilize different templates and underlying data, and when unexpected variations appear in previously correctly formatted documents, that’s a problem for us and our customers. Our customers are entering the busiest period of their year, the fall months, when they produce the largest volume of documents.

As @jrubright mentions, when we attempted to upgrade our Aspose libraries earlier this year it produced so many unexpected differences in document formatting that our clients couldn’t manage the amount of re-configuration and other changes needed to mitigate the unplanned changes. Yes, that updgrade also solved some previously identified issues, but it introduced many more differences in output format that the client would have to mitigate. In summary, asking us to upgrade the libraries to correct a minor problem is not easy for us to accommodate if it will produce many other changes in document outputs.

In this particular case, the issue appears to be only with the Word-to-PDF conversion.

@jcvanbesien,

Please note that we exercise unit testing and all of our unit tests are properly structured. Therefore, upgrading to the latest version of Aspose.Words for .NET is safe and the latest version should cause no undesired behavior. Since, all Aspose.Words functionality is unit tested so everything in the previous versions shall still be working in the newer versions. With each monthly release, we fix many bugs and integrate new features and also try to make Aspose.Words’ behavior closer to what output MS Word would have produced in PDF (using its ‘Save As’ command).

Can you please ZIP and attach the following resources here for testing?

  • Your simplified input Word document
  • Aspose.Words 19.8 generated output document showing the undesired behavior
  • Aspose.Words 14.12 generated output document showing the correct behavior
  • Please also provide a comparison screenshot highlighting the problematic areas in Aspose.Words 19.8 generated PDF file (with respect to 14.12 generated PDF file) and attach it here for our reference. Please point out the exact problematic places for this issue

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.