PDF converted from Word has extra row and pushes content to next page

Hi,

When converting a DOCX to PDF using Aspose.Words, we noticed an extra row was created on the first page text and eventually pushed some content into next page, resulting in extra page created.

Code:

var doc = new Document(@".\test.docx");
doc.Save(@".\out.pdf", new PdfSaveOptions());

I’ve attached test files, the used font file and a screenshot for your reference. Could you please help check?

test.zip (5.1 MB)

Thanks,

@ServerSide527

When converting a DOCX file to PDF using Aspose.Words, if you encounter an issue where an extra row is created on the first page, causing some content to be pushed to the next page, there are a few potential solutions you can try.

  1. Check Page Setup: Ensure that the page setup in your DOCX file is correct. Sometimes, margins or page size settings can lead to unexpected layout changes during conversion.

  2. Adjust PdfSaveOptions: You can customize the PdfSaveOptions to better control the output. For example, you might want to experiment with options like EmbedFullFonts, ImageCompression, or OptimizeOutput to see if they affect the layout. Here’s a basic example of how to set these options:

    var doc = new Document(@".\test.docx");
    PdfSaveOptions saveOptions = new PdfSaveOptions
    {
        EmbedFullFonts = true,
        ImageCompression = PdfImageCompression.Jpeg,
        OptimizeOutput = true
    };
    doc.Save(@".\out.pdf", saveOptions);
    
  3. Inspect the Document Structure: Sometimes, the structure of the document itself (like tables, images, or other elements) can cause layout issues. Make sure that there are no hidden elements or formatting that could be affecting the output.

  4. Update Aspose.Words: Ensure that you are using the latest version of Aspose.Words, as updates often include bug fixes and improvements that could resolve your issue.

  5. Review Warnings: If there are any warnings during the conversion process, they can provide insights into what might be going wrong. You can implement a warning callback to capture these warnings:

    HandleDocumentWarnings callback = new HandleDocumentWarnings();
    doc.WarningCallback = callback;
    doc.Save(@".\out.pdf", saveOptions);
    foreach (WarningInfo warningInfo in callback.mWarnings)
    {
        Console.WriteLine(warningInfo.Description);
    }
    

If these suggestions do not resolve the issue, consider sharing the specific DOCX file and the generated PDF for further analysis. This will help in diagnosing the problem more accurately.

Sources:
[1]: Working with PdfSaveOptions

@ServerSide527
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): WORDSNET-28226

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.