作成日: 2023/08/18 最終更新日: 2023/08/18
文書種別
使用方法
詳細
ViewerPreferences および OpenActionプロパティを使用してPDFの開き方を設定できます。
using GrapeCity.Documents.Pdf; using GrapeCity.Documents.Pdf.Actions; var doc = new GcPdfDocument(); var page = doc.NewPage(); // 表示:ページパネル(サムネイル)とページ doc.ViewerPreferences.PageMode = PageMode.UseThumbs; // ページレイアウト:単一ページ doc.ViewerPreferences.PageLayout = PageLayout.SinglePage; // 倍率:全体表示 doc.OpenAction = new ActionGoTo(new DestinationFit(page)); // 倍率:幅に合わせる doc.OpenAction = new ActionGoTo(new DestinationFitH(page)); // 倍率:200% doc.OpenAction = new ActionGoTo(new DestinationXYZ(page, null, null, 2.0f)); doc.Save("ViewerPreferences.pdf");
■補足
PDFの開き方が正しく動作するかはPDFを表示するアプリケーション側の仕様に依存します。
ブラウザ組み込みのビューワなどでは設定が有効にならない可能性があります。
※DioDocsのPDFビューワは v4.1.3 (V6J SP1) でPDFの開き方に対応しました。