Orientation landscape not working for pdf

I have created template with portrait orientation and added merge filed, output of word will be good but same template convert into landscape pdf as output of table will not auto shrink and expand such as word so can you check it and let me know the cause for same, let me know if have any doubt, added imf for refrence

used below code for convert template into landscape using java

doc.getFirstSection().getPageSetup().setOrientation(Orientation.LANDSCAPE);

@kalpeshAspose1997 can you please attach your source document (doc, docx, etc.).

yes @eduardo.canal ,
output_pdf.png (8.7 KB)
output_word.docx (23.9 KB)
template file : input.docx (24.0 KB)

portrait template convert into landscape word - worked
portrait template convert into landscape pdf - not worked

1 Like

@kalpeshAspose1997
I was able to replicate your issue.
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-25333

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.

@kalpeshAspose1997 It is not a bug. It is require to autofit the table to window to get the expected result

Document doc = new Document(@"C:\Temp\in.docx");

doc.FirstSection.PageSetup.Orientation = Orientation.Landscape;

foreach (Table t in doc.FirstSection.GetChildNodes(NodeType.Table, true))
    t.AutoFit(AutoFitBehavior.AutoFitToWindow);

doc.Save(@"C:\Temp\out.pdf"); 

FYI @eduardo.canal

1 Like

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