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

Free Support Forum - aspose.com

Zoom content in word

HI,

I try to convert word to pdf using aspose library, But i need to zoom content in input word file, How can i possible this.

In excel content zoom is possible by
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(inputFilePath);
foreach (Aspose.Cells.Worksheet sheet in workbook.Worksheets)
{
sheet.PageSetup.Zoom = 112;
}

Like this i tried in word to pdf conversion by two way given below, but it zoom the pdf view only, not content.
Try 1-
Aspose.Words.Document doc = new Aspose.Words.Document(inputFilePath);
doc.ViewOptions.ZoomPercent = 120;

Try 2-
var opt = new Aspose.Words.Saving.PdfSaveOptions();
opt.ZoomBehavior = Aspose.Words.Saving.PdfZoomBehavior.ZoomFactor;
opt.ZoomFactor = 120;


Hi Varun,

Thanks for your inquiry. Please note that Aspose.Cells and Aspose.Words are two different products. Scale to fit feature of MS Excel is different in MS Word. Please read about shrink to Fit feature in MS Word from here. Please note that Aspose.Words mimics the same behavior as MS Word does.

In your case, I suggest you please set font size of text according to your requirements. Please use the following code example to achieve your requirements.


Document doc = new Document(MyDir + "in.docx");

foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))

{

para.ParagraphFormat.SpaceAfter = 0;

para.ParagraphFormat.SpaceBefore = 0;

para.ParagraphFormat.LineSpacing = 0;

para.ParagraphFormat.LineSpacingRule = LineSpacingRule.AtLeast;

para.ParagraphBreakFont.Size = 5;

foreach (Run run in para.Runs)

{

run.Font.Size = 5;

}

}

doc.Save(MyDir + "Out.pdf");