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

Free Support Forum - aspose.com

We have couple of issues in word to PDF using ASPOSE 21.3 ex: Text characters splitted in two rows

we are creating Consolidated PDF for different formats to PDF and finally merging using ASPOSE,
We have few issues while converting WORD To PDF , as a result we consolidated PDF quality was not good, attaching few observations, hope i wll get reply soon, if solution not available immediately please share ETA with us.

We have couple of issues in word to PDF using ASPOSE 21.3
1 Text characters splitted in two rowsASPOSE_impacted.zip (1.2 MB)

2.- observed data cutting
3.Spaces missed between the text

Code used to convert word to PDF

Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense(AppDomain.CurrentDomain.BaseDirectory + "\\Aspose.Total.lic");
Aspose.Words.Document document = null;//RTF to PDF
document = new Aspose.Words.Document(pInFile);
document.TrackRevisions = false;
document.RevisionsView = RevisionsView.Final;
document.AcceptAllRevisions();

LayoutCollector collector = new LayoutCollector(document);
LayoutEnumerator enumerator = new LayoutEnumerator(document);

// Get Tables which are wider than their parent Sections
Dictionary<Table, double> keyValuePairs = new Dictionary<Table, double>();
foreach (Section section in document.Sections)
{
    foreach (Table table in section.Body.Tables)
    {
        //table.AutoFit(AutoFitBehavior.AutoFitToContents);
        double tableWidth = GetTableWidth(collector, enumerator, table);

        if (section.PageSetup.PageWidth < tableWidth)
            keyValuePairs.Add(table, tableWidth);
    }
}

ArrayList uniqueSections = new ArrayList();
foreach (KeyValuePair<Aspose.Words.Tables.Table, double> kvp in keyValuePairs)
{
    Aspose.Words.Section section = (Section)kvp.Key.GetAncestor(NodeType.Section);
    if (!uniqueSections.Contains(section))
        uniqueSections.Add(section);
}

// for each sections, get the Tables with maximum widths
Dictionary<Table, double> tablesWithMaxWidths = new Dictionary<Table, double>();
foreach (Section section in uniqueSections)
{
    double maxWidth = 0;
    Table theTable = null;
    foreach (KeyValuePair<Table, double> kvp in keyValuePairs)
    {
        if (kvp.Key.GetAncestor(NodeType.Section) == section)
        {
            if (kvp.Value > maxWidth)
            {
                maxWidth = kvp.Value;
                theTable = kvp.Key;
            }
        }
    }
    tablesWithMaxWidths.Add(theTable, maxWidth);
}

// Increase widths of Sections
foreach (KeyValuePair<Table, double> kvp in tablesWithMaxWidths)
{
    Section section = (Section)kvp.Key.GetAncestor(NodeType.Section);
    section.PageSetup.PageWidth = kvp.Value;
}
document.UpdatePageLayout();
//New Code ends here
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions
{
    SaveFormat = SaveFormat.Pdf
};
document.Save(pOutFile, pdfSaveOptions);

forgot to update the problematic text was highlighted in both word and pdf documents for your quick reference

@Haranath Thank you for reporting the problems to us.

  1. I have managed to reproduce the problem with 1538329022.DOC and incorrect text justification. The problem has been logged as WORDSNET-23364. We will keep you informed and let you know once it is resolved.

  2. Unfortunately, I cannot reproduce the problem with another 1538267426.DOC with the latest 22.1 version of Aspose.Words for .NET. It is rendered properly on my side. Though I have used a simple conversion code for testing:

Document doc = new Document(@"C:\Temp\in.doc");
doc.Save(@"C:\Temp\out.pdf");

I did not manage to run your code because GetTableWidth method is missed. Could you please try using the latest 22.1 version of Aspose.Words and if the problem is still there provide this method code too.

forgot to update the problematic text was highlighted in both word and pdf documents for your quick reference

@Haranath Thank you for additional information. We have noticed the problematic places in the documents are highlighted. But still with the latest 22.1 version of Aspose.Words for .NET the 1538267426.DOC document is rendered without issues. Please try using the latest version and let us know how it goes on your side.

Hi Small Info need from ASPOSE team

ASPOSE 21.3 is compatible with Windows server 2019 standard?

@Haranath Yes, Aspose.Words 21.3 is fully compatible with Windows Server 2019.

The issues you have found earlier (filed as WORDSNET-23364) have been fixed in this Aspose.Words for .NET 22.2 update also available on NuGet.

[quote=“alexey.noskov, post:3, topic:240846”]

Document doc = new Document(@"C:\Temp\in.doc");
doc.Save(@"C:\Temp\out.pdf");

[/quote

Hi Still iam able to reproduce WORDSNET-23364 in 22.2 for same document, could you please reverify.1538329022.pdf (62.2 KB)

@Haranath The attached document has been produced by old 21.3 version of Aspose.Words. With the latest 22.2 version the document is converted properly. Please see the attached document.1538329022.pdf (61.3 KB)

thank you, i might be using old version dll, i will recheck again,