Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/b746eba8ca6e64b59fbec6a27bcdc829 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/b746eba8ca6e64b59fbec6a27bcdc829 to your computer and use it in GitHub Desktop.
Change Settings for Opening PDF using C#. For further details: https://kb.aspose.com/pdf/net/change-settings-for-opening-pdf-using-csharp/
using Aspose.Pdf;
class Program
{
static void Main(string[] args)
{
new License().SetLicense("License.lic");
// Open document
Document pdfDocument = new Document("sample.pdf");
pdfDocument.CenterWindow = true;
pdfDocument.Direction = Direction.R2L;
pdfDocument.DisplayDocTitle = true;
pdfDocument.FitWindow = true;
pdfDocument.HideMenubar = true;
pdfDocument.HideToolBar = true;
pdfDocument.HideWindowUI = true;
pdfDocument.NonFullScreenPageMode = PageMode.UseOC;
pdfDocument.PageLayout = PageLayout.TwoColumnLeft;
pdfDocument.PageMode = PageMode.UseThumbs;
pdfDocument.Save("output.pdf");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment