/// <summary>This method sets the paper handling option that shall be used when printing the file from the print dialog. /// </summary> /// <remarks> /// This method sets the paper handling option that shall be used when printing the file from the print dialog. /// The following values are valid: Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge. /// </remarks> /// <param name="duplex"/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetDuplex(PdfViewerPreferences.PdfViewerPreferencesConstants duplex) { switch (duplex) { case PdfViewerPreferences.PdfViewerPreferencesConstants.SIMPLEX: { Put(PdfName.Duplex, PdfName.Simplex); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.DUPLEX_FLIP_SHORT_EDGE: { Put(PdfName.Duplex, PdfName.DuplexFlipShortEdge); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.DUPLEX_FLIP_LONG_EDGE: { Put(PdfName.Duplex, PdfName.DuplexFlipLongEdge); break; } default: { break; } } return(this); }
/// <summary>This method sets NonFullScreenPageMode property.</summary> /// <remarks> /// This method sets NonFullScreenPageMode property. Allowed values are UseNone, UseOutlines, useThumbs, UseOC. /// This entry is meaningful only if the value of the PageMode entry in the Catalog dictionary is FullScreen /// </remarks> /// <param name="nonFullScreenPageMode">NonFullScreenPageMode property type value</param> /// <returns> /// current instance of /// <see cref="PdfViewerPreferences"/> /// </returns> public virtual PdfViewerPreferences SetNonFullScreenPageMode(PdfViewerPreferences.PdfViewerPreferencesConstants nonFullScreenPageMode) { switch (nonFullScreenPageMode) { case PdfViewerPreferences.PdfViewerPreferencesConstants.USE_NONE: { Put(PdfName.NonFullScreenPageMode, PdfName.UseNone); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.USE_OUTLINES: { Put(PdfName.NonFullScreenPageMode, PdfName.UseOutlines); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.USE_THUMBS: { Put(PdfName.NonFullScreenPageMode, PdfName.UseThumbs); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.USE_OC: { Put(PdfName.NonFullScreenPageMode, PdfName.UseOC); break; } default: { break; } } return(this); }
/// <summary>This method sets predominant reading order of text.</summary> /// <param name="direction"/> /// <returns/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetDirection(PdfViewerPreferences.PdfViewerPreferencesConstants direction) { switch (direction) { case PdfViewerPreferences.PdfViewerPreferencesConstants.LEFT_TO_RIGHT: { Put(PdfName.Direction, PdfName.L2R); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.RIGHT_TO_LEFT: { Put(PdfName.Direction, PdfName.R2L); break; } default: { break; } } return this; }
/// <summary> /// This method sets the page scaling option that shall be selected when a print dialog is displayed for this /// document. /// </summary> /// <remarks> /// This method sets the page scaling option that shall be selected when a print dialog is displayed for this /// document. Valid values are None and AppDefault. /// </remarks> /// <param name="printScaling"/> /// <returns/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetPrintScaling(PdfViewerPreferences.PdfViewerPreferencesConstants printScaling) { switch (printScaling) { case PdfViewerPreferences.PdfViewerPreferencesConstants.NONE: { Put(PdfName.PrintScaling, PdfName.None); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.APP_DEFAULT: { Put(PdfName.PrintScaling, PdfName.AppDefault); break; } default: { break; } } return this; }
private iText.Kernel.Pdf.PdfViewerPreferences SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants viewerPreferenceType, PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) { PdfName type = null; switch (viewerPreferenceType) { case PdfViewerPreferences.PdfViewerPreferencesConstants.VIEW_AREA: { type = PdfName.ViewArea; break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.VIEW_CLIP: { type = PdfName.ViewArea; break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_AREA: { type = PdfName.ViewArea; break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_CLIP: { type = PdfName.ViewArea; break; } default: { break; } } if (type != null) { switch (pageBoundary) { case PdfViewerPreferences.PdfViewerPreferencesConstants.MEDIA_BOX: { Put(type, PdfName.MediaBox); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.CROP_BOX: { Put(type, PdfName.CropBox); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.BLEED_BOX: { Put(type, PdfName.BleedBox); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.TRIM_BOX: { Put(type, PdfName.TrimBox); break; } case PdfViewerPreferences.PdfViewerPreferencesConstants.ART_BOX: { Put(type, PdfName.ArtBox); break; } default: { break; } } } return(this); }
/// <summary> /// This method sets the name of the page boundary to which the contents of a page shall be clipped when /// printing the document. /// </summary> /// <remarks> /// This method sets the name of the page boundary to which the contents of a page shall be clipped when /// printing the document. /// Deprecated in PDF 2.0. /// </remarks> /// <param name="pageBoundary"/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetPrintClip(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) { return(SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_CLIP, pageBoundary)); }
/// <summary> /// This method sets the name of the page boundary representing the area of a page that shall be displayed when /// viewing the document on the screen. /// </summary> /// <remarks> /// This method sets the name of the page boundary representing the area of a page that shall be displayed when /// viewing the document on the screen. /// Deprecated in PDF 2.0. /// </remarks> /// <param name="pageBoundary"/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetViewArea(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) { return(SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.VIEW_AREA, pageBoundary)); }
/// <summary> /// This method sets the name of the page boundary representing the area of a page that shall be /// rendered when printing the document. /// </summary> /// <remarks> /// This method sets the name of the page boundary representing the area of a page that shall be /// rendered when printing the document. /// Deprecated in PDF 2.0. /// </remarks> /// <param name="pageBoundary">page boundary type value</param> /// <returns> /// current instance of /// <see cref="PdfViewerPreferences"/> /// </returns> public virtual PdfViewerPreferences SetPrintArea(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary ) { return(SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_AREA, pageBoundary)); }
/// <summary> /// This method sets the name of the page boundary to which the contents of a page shall be clipped when /// viewing the document on the screen. /// </summary> /// <remarks> /// This method sets the name of the page boundary to which the contents of a page shall be clipped when /// viewing the document on the screen. /// Deprecated in PDF 2.0. /// </remarks> /// <param name="pageBoundary">page boundary type value</param> /// <returns> /// current instance of /// <see cref="PdfViewerPreferences"/> /// </returns> public virtual PdfViewerPreferences SetViewClip(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary ) { return(SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.VIEW_CLIP, pageBoundary)); }
/// <summary> /// This method sets the name of the page boundary to which the contents of a page shall be clipped when /// viewing the document on the screen. /// </summary> /// <param name="pageBoundary"/> /// <returns/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetViewClip(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) { return SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.VIEW_CLIP, pageBoundary); }
/// <summary> /// This method sets the name of the page boundary representing the area of a page that shall be /// rendered when printing the document. /// </summary> /// <param name="pageBoundary"/> /// <returns/> public virtual iText.Kernel.Pdf.PdfViewerPreferences SetPrintArea(PdfViewerPreferences.PdfViewerPreferencesConstants pageBoundary) { return SetPageBoundary(PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_AREA, pageBoundary); }