Class PdfSaveOptions
Le nom : Aspose.Cells Assemblée: Aspose.Cells.dll (25.4.0)
Presenta le opzioni per salvare il file PDF.
public class PdfSaveOptions : PaginatedSaveOptions
Inheritance
object ← SaveOptions ← PaginatedSaveOptions ← PdfSaveOptions
Constructors
PdfSaveOptions()
Crea le opzioni per salvare il file PDF.
public PdfSaveOptions()
Properties
Bookmark
Riceve e imposta l’oggetto Aspose.Cells.Rendering.PdfBookmarkEntry?text=PdfBookmarkEntry.
public PdfBookmarkEntry Bookmark { get; set; }
Valore di proprietà
CalculateFormula
Indica se calcolare le formule prima di salvare il file pdf.
public bool CalculateFormula { get; set; }
Valore di proprietà
Remarks
Il valore default è falso.
Compliance
Riceve o impone il livello di conformità delle norme PDF per i documenti di uscita.
public PdfCompliance Compliance { get; set; }
Valore di proprietà
Remarks
Il codice è PDF17.
CreatedTime
Riceve e impone il tempo di generare il documento pdf.
public DateTime CreatedTime { get; set; }
Valore di proprietà
Remarks
Se non viene impostato, sarà il momento di generare il pdf.
CustomPropertiesExport
Riceve o impone un valore determinando come Aspose.Cells.Properties.CustomDocumentPropertyCollection viene esportato al file PDF.
public PdfCustomPropertiesExport CustomPropertiesExport { get; set; }
Valore di proprietà
DisplayDocTitle
Indica se la barra di titolo della finestra dovrebbe visualizzare il titolo del documento.
public bool DisplayDocTitle { get; set; }
Valore di proprietà
Remarks
Se falso, la barra di titolo dovrebbe invece visualizzare il nome del file PDF.Il valore default è falso.
EmbedAttachments
Indica se integrare un allegato per gli oggetti Ole in Excel.
public bool EmbedAttachments { get; set; }
Valore di proprietà
Remarks
Il valore predefinito è falso.Il valore deve essere falso quando viene impostata la conformità PDF/A o quando è abilitata la crittografia PDF.
EmbedStandardWindowsFonts
Un vero e proprio tipo di font.Infligge solo i caratteri ASCII 32-127.Le font per i codici di carattere superiori a 127 sono sempre incorporate.Le font sono sempre incorporate per PDF/A-1a, PDF/A-1b standard.Il default è vero.
public bool EmbedStandardWindowsFonts { get; set; }
Valore di proprietà
ExportDocumentStructure
Indica se per esportare la struttura del documento.
public bool ExportDocumentStructure { get; set; }
Valore di proprietà
FontEncoding
Ottieni o metti codifica di font incorporati in pdf.
public PdfFontEncoding FontEncoding { get; set; }
Valore di proprietà
Remarks
Il valore predefinito è Aspose.Cells.Rendering.PdfFontEncoding.Identità
ImageType
Il représente le type d’image lors de la conversion du diagramme et du format.
[Obsolete("Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.")]
[Browsable(false)]
public ImageType ImageType { get; set; }
Valore di proprietà
Remarks
Nota: questo membro è ormai obsoleto. invece,Le graphique et la forme sont toujours rendus comme des éléments vecteurs (par exemple, point, ligne) pour le rendu de la qualité.Cette propriété sera retirée 12 mois plus tard à partir de juin 2022.Aspose scusa per qualsiasi inconveniente che potresti aver sperimentato.
OptimizationType
Riceve e impone il tipo di ottimizzazione PDF.
public PdfOptimizationType OptimizationType { get; set; }
Valore di proprietà
Remarks
Il valore predefinito è Aspose.Cells.Rendering.PdfOptimizationType.Standard
PdfCompression
Indica l’algoritmo di compressione
public PdfCompressionCore PdfCompression { get; set; }
Valore di proprietà
Producer
Riceve e stabilisce il produttore del documento pdf generato.
public string Producer { get; set; }
Valore di proprietà
Remarks
Se il valore è nulo, o non viene impostata una licenza valida, verrà utilizzata la riga Aspose.Cells vVERSION.
SecurityOptions
Imposta questa opzione, quando la sicurezza è necessaria nel risultato xls2pdf.
public PdfSecurityOptions SecurityOptions { get; set; }
Valore di proprietà
Examples
Il seguente codice impone il permesso di stampa ad alta risoluzione per la produzione pdf.
Workbook wb = new Workbook();
wb.Worksheets[0].Cells["A1"].Value = "Aspose";
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
PdfSecurityOptions pdfSecurityOptions = new PdfSecurityOptions();
//set owner password
pdfSecurityOptions.OwnerPassword = "YourOwnerPassword";
//set user password
pdfSecurityOptions.UserPassword = "YourUserPassword";
//set print permisson
pdfSecurityOptions.PrintPermission = true;
//set high resolution for print
pdfSecurityOptions.FullQualityPrintPermission = true;
pdfSaveOptions.SecurityOptions = pdfSecurityOptions;
wb.Save("output.pdf", pdfSaveOptions);
Watermark
Riceve o mette il marchio idrico alla produzione.
public RenderingWatermark Watermark { get; set; }
Valore di proprietà
Examples
Il seguente codice inserisce il marchio idrico nella versione pdf.
//prepare a workbook with 3 pages.
Workbook wb = new Workbook();
wb.Worksheets[0].Cells["A1"].PutValue("Page1");
int index = wb.Worksheets.Add();
wb.Worksheets[index].Cells["A1"].PutValue("Page2");
index = wb.Worksheets.Add();
wb.Worksheets[index].Cells["A1"].PutValue("Page3");
wb.Worksheets[index].PageSetup.PaperSize = PaperSizeType.PaperA3;
//create a font for watermark, and specify bold, italic, color
RenderingFont font = new RenderingFont("Calibri", 68);
font.Italic = true;
font.Bold = true;
font.Color = Color.Blue;
//create a watermark from text and the specified font
RenderingWatermark watermark = new RenderingWatermark("Watermark", font);
//specify horizontal and vertical alignment
watermark.HAlignment = TextAlignmentType.Center;
watermark.VAlignment = TextAlignmentType.Center;
//specify rotation
watermark.Rotation = 30;
//specify opacity
watermark.Opacity = 0.6f;
//specify the scale to page(e.g. 100, 50) in percent.
watermark.ScaleToPagePercent = 50;
//spcify watermark for rendering to pdf.
PdfSaveOptions options = new PdfSaveOptions();
options.Watermark = watermark;
wb.Save("output_watermark.pdf", options);
Methods
SetImageResample(int, int)
Set desiderato PPI (pixel per pollice) di immagini di campione e qualità jpeg. Tutte le immagini saranno convertite in JPEG con la configurazione di qualità specificata,e le immagini che sono più grandi del PPI specificato (pixel per pollice) saranno riassemblate.
public void SetImageResample(int desiredPPI, int jpegQuality)
Parameters
desiredPPI
int
Pixel desiderati per pollice. 220 di alta qualità. 150 di qualità dello schermo. 96 di qualità email.
jpegQuality
int
0 - 100% qualità JPEG.
Examples
Il codice seguente impone il PPI desiderato come 96 e la qualità jpeg come 80 per le immagini nella produzione pdf.
//load the source file with images.
Workbook wb = new Workbook("Book1.xlsx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
//set desired PPI as 96 and jpeg quality as 80.
pdfSaveOptions.SetImageResample(96, 80);
wb.Save("output.pdf", pdfSaveOptions);