Click here to Skip to main content
15,915,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

how to set default pdf size is 100 % while opening a pdf using abcpdf in dot net.
please can any one help me.
Posted

1 solution

Refer this

C#
PdfWriter writer = PdfWriter.GetInstance(doc, HttpContext.Current.Response.OutputStream);

//this creates a new destination to send the action to when the document is opened. The zoom in this instance is set to 0.75f (75%). Again I use doc.PageSize.Height to set the y coordinate to the top of the page. PdfDestination.XYZ is a specific PdfDestination Type that allows us to set the location and zoom.
PdfDestination pdfDest = new PdfDestination(PdfDestination.XYZ, 0, doc.PageSize.Height, 0.75f);

//open our document
doc.Open();

//here you put all the information you want to write to your PDF

//create a new action to send the document to our new destination.
PdfAction action = PdfAction.GotoLocalPage(1, pdfDest, writer);

//set the open action for our writer object
writer.SetOpenAction(action);

//finally, close our document
doc.Close();




http://www.developerbarn.com/community/entries/set-initial-pdf-document-zoom-using-itextsharp.45/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900