Class PdfSaveOptions
ชื่อพื้นที่: Aspose.Note.Saving การประกอบ: Aspose.Note.dll (25.4.0)
อนุญาตให้ระบุตัวเลือกเพิ่มเติมเมื่อ rendering หน้าเอกสารเป็น PDF
public sealed class PdfSaveOptions : SaveOptions
Inheritance
object ← SaveOptions ← PdfSaveOptions
อนุญาโตตุลาการ
SaveOptions.SaveFormat , SaveOptions.FontsSubsystem , SaveOptions.PageIndex , SaveOptions.PageCount , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF ด้วยการจัดตั้งหน้าจดหมาย
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "OneNote.one");
var dst = Path.Combine(dataDir, "SaveToPdfUsingLetterPageSettings.pdf");
// Save the document.
oneFile.Save(dst, new PdfSaveOptions() { PageSettings = PageSettings.Letter });
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF ด้วยการจัดตั้งหน้า A4 โดยไม่มีข้อ จํากัด ความสูง
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "OneNote.one");
var dst = Path.Combine(dataDir, "SaveToPdfUsingA4PageSettingsWithoutHeightLimit.pdf");
// Save the document.
oneFile.Save(dst, new PdfSaveOptions() { PageSettings = PageSettings.A4NoHeightLimit });
แสดงวิธีการบันทึกหนังสือเล่มในรูปแบบ PDF ด้วยตัวเลือกที่ระบุ
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
var notebookSaveOptions = new NotebookPdfSaveOptions();
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
dataDir = dataDir + "ConvertToPDF_out.pdf";
// Save the Notebook
notebook.Save(dataDir, notebookSaveOptions);
เมื่อหน้า OneNote ระยะยาวจะถูกบันทึกในรูปแบบ PDF พวกเขาจะแบ่งออกระหว่างหน้า ตัวอย่างแสดงให้เห็นวิธีการตั้งค่าโลจิกการแบ่งของวัตถุที่ตั้งอยู่บนช่องว่างของหน้า
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(100);
// or
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(400);
dataDir = dataDir + "PageSplittUsingKeepPartAndCloneSolidObjectToNextPageAlgorithm_out.pdf";
doc.Save(dataDir);
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
// Initialize PdfSaveOptions object
PdfSaveOptions opts = new PdfSaveOptions
{
// Set page index of first page to be saved
PageIndex = 0,
// Set page count
PageCount = 1,
};
// Save the document as PDF
dataDir = dataDir + "SaveRangeOfPagesAsPDF_out.pdf";
oneFile.Save(dataDir, opts);
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF โดยใช้การตั้งค่าเฉพาะ
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
// Initialize PdfSaveOptions object
PdfSaveOptions opts = new PdfSaveOptions
{
// Use Jpeg compression
ImageCompression = Saving.Pdf.PdfImageCompression.Jpeg,
// Quality for JPEG compression
JpegQuality = 90
};
dataDir = dataDir + "Document.SaveWithOptions_out.pdf";
doc.Save(dataDir, opts);
เมื่อหน้า OneNote ระยะยาวจะถูกบันทึกในรูปแบบ PDF พวกเขาจะแบ่งเป็นหน้า ตัวอย่างแสดงให้เห็นว่าวิธีการตั้งค่าโลจิกการแบ่งของวัตถุที่ตั้งอยู่บนช่องว่างของหน้า
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSplittingAlgorithm = new AlwaysSplitObjectsAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
float heightLimitOfClonedPart = 500;
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(heightLimitOfClonedPart);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(heightLimitOfClonedPart);
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(100);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(400);
dataDir = dataDir + "UsingKeepSOlidObjectsAlgorithm_out.pdf";
doc.Save(dataDir);
Constructors
PdfSaveOptions()
public PdfSaveOptions()
Properties
ImageCompression
รับหรือตั้งค่าประเภทการบีบอัดที่นําไปใช้กับภาพในไฟล์ PDF
public PdfImageCompression ImageCompression { get; set; }
คุณสมบัติมูลค่า
Examples
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF โดยใช้การตั้งค่าเฉพาะ
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
// Initialize PdfSaveOptions object
PdfSaveOptions opts = new PdfSaveOptions
{
// Use Jpeg compression
ImageCompression = Saving.Pdf.PdfImageCompression.Jpeg,
// Quality for JPEG compression
JpegQuality = 90
};
dataDir = dataDir + "Document.SaveWithOptions_out.pdf";
doc.Save(dataDir, opts);
JpegQuality
รับหรือตั้งค่าที่กําหนดคุณภาพของภาพ JPEG ในเอกสาร PDFค่าใช้จ่ายอาจแตกต่างจาก 0 ถึง 100 ที่ 0 หมายถึงคุณภาพไม่ดี แต่การบีบอัดสูงสุดและ 100 หนึ่งหมายความคุณภาพดีที่สุด แต่มันเป็นภาวะแทรกซึมขั้นต่ํา
public int JpegQuality { get; set; }
คุณสมบัติมูลค่า
Examples
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF โดยใช้การตั้งค่าเฉพาะ
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
// Initialize PdfSaveOptions object
PdfSaveOptions opts = new PdfSaveOptions
{
// Use Jpeg compression
ImageCompression = Saving.Pdf.PdfImageCompression.Jpeg,
// Quality for JPEG compression
JpegQuality = 90
};
dataDir = dataDir + "Document.SaveWithOptions_out.pdf";
doc.Save(dataDir, opts);
Remarks
หมายเลขค่าเริ่มต้นคือ 90.
PageSettings
รับหรือตั้งค่าหน้าสําหรับแต่ละหน้าในเอกสารโดยเริ่มต้นขึ้นอยู่กับ CurrentUICulture, *วัฒนธรรมของสหรัฐอเมริกามีการตั้งค่าตัวอักษรอื่น ๆ มีการกําหนดค่า A4
public PageSettings PageSettings { get; set; }
คุณสมบัติมูลค่า
Examples
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF ด้วยการจัดตั้งหน้าจดหมาย
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "OneNote.one");
var dst = Path.Combine(dataDir, "SaveToPdfUsingLetterPageSettings.pdf");
// Save the document.
oneFile.Save(dst, new PdfSaveOptions() { PageSettings = PageSettings.Letter });
แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF ด้วยการจัดตั้งหน้า A4 โดยไม่มีข้อ จํากัด ความสูง
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "OneNote.one");
var dst = Path.Combine(dataDir, "SaveToPdfUsingA4PageSettingsWithoutHeightLimit.pdf");
// Save the document.
oneFile.Save(dst, new PdfSaveOptions() { PageSettings = PageSettings.A4NoHeightLimit });
PageSplittingAlgorithm
รับหรือตั้งค่าแอลกอฮอร์โมนที่ใช้สําหรับการแบ่งหน้า
public PageSplittingAlgorithm PageSplittingAlgorithm { get; set; }
คุณสมบัติมูลค่า
Examples
แสดงวิธีการบันทึกหนังสือเล่มในรูปแบบ PDF ด้วยตัวเลือกที่ระบุ
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_NoteBook();
// Load a OneNote Notebook
var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
var notebookSaveOptions = new NotebookPdfSaveOptions();
var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
documentSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
dataDir = dataDir + "ConvertToPDF_out.pdf";
// Save the Notebook
notebook.Save(dataDir, notebookSaveOptions);
เมื่อหน้า OneNote ระยะยาวจะถูกบันทึกในรูปแบบ PDF พวกเขาจะแบ่งออกระหว่างหน้า ตัวอย่างแสดงให้เห็นวิธีการตั้งค่าโลจิกการแบ่งของวัตถุที่ตั้งอยู่บนช่องว่างของหน้า
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(100);
// or
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(400);
dataDir = dataDir + "PageSplittUsingKeepPartAndCloneSolidObjectToNextPageAlgorithm_out.pdf";
doc.Save(dataDir);
เมื่อหน้า OneNote ระยะยาวจะถูกบันทึกในรูปแบบ PDF พวกเขาจะแบ่งเป็นหน้า ตัวอย่างแสดงให้เห็นว่าวิธีการตั้งค่าโลจิกการแบ่งของวัตถุที่ตั้งอยู่บนช่องว่างของหน้า
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document doc = new Document(dataDir + "Aspose.one");
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.PageSplittingAlgorithm = new AlwaysSplitObjectsAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm();
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm();
float heightLimitOfClonedPart = 500;
pdfSaveOptions.PageSplittingAlgorithm = new KeepPartAndCloneSolidObjectToNextPageAlgorithm(heightLimitOfClonedPart);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(heightLimitOfClonedPart);
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(100);
// Or
pdfSaveOptions.PageSplittingAlgorithm = new KeepSolidObjectsAlgorithm(400);
dataDir = dataDir + "UsingKeepSOlidObjectsAlgorithm_out.pdf";
doc.Save(dataDir);