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);