Class SaveOptions
이름 공간 : Aspose.Note.Saving 모임: Aspose.Note.dll (25.4.0)
특정 형식에 대한 문서 저장 옵션을 나타내는 추상 기반 클래스입니다.
public abstract class SaveOptions
Inheritance
Derived
HtmlSaveOptions , ImageSaveOptions , OneSaveOptions , PdfSaveOptions
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
SaveOptions(SaveFormat)
Aspose.Note.Saving.saveOptions 클래스의 새로운 예를 시작합니다.
protected SaveOptions(SaveFormat saveFormat)
Parameters
saveFormat
SaveFormat
저장 형식으로 설정합니다.
Properties
FontsSubsystem
저장하는 동안 사용할 수 있는 글꼴 설정을 얻거나 설정합니다.
public FontsSubsystem FontsSubsystem { 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(Path.Combine(dataDir, "missing-font.one"));
// Save the document as PDF
dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontName_out.pdf";
oneFile.Save(dataDir, new PdfSaveOptions()
{
FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFont("Times New Roman")
});
PDF 형식의 문서를 기본 글꼴을 사용하여 파일에서 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fontFile = Path.Combine(dataDir, "geo_1.ttf");
// Load the document into Aspose.Note.
Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
// Save the document as PDF
dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromFile_out.pdf";
oneFile.Save(dataDir, new PdfSaveOptions()
{
FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromFile(fontFile)
});
PDF 형식의 문서를 기본 글꼴을 사용하여 스트림에서 저장하는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fontFile = Path.Combine(dataDir, "geo_1.ttf");
// Load the document into Aspose.Note.
Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
// Save the document as PDF
dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromStream_out.pdf";
using (var stream = File.Open(fontFile, FileMode.Open, FileAccess.Read, FileShare.Read))
{
oneFile.Save(dataDir, new PdfSaveOptions()
{
FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromStream(stream)
});
}
PageCount
얻거나 저장할 페이지 수를 설정합니다. 기본적으로 System.Int32.MaxValue입니다.즉, 문서의 모든 페이지가 전달될 것입니다.
public int PageCount { 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 + "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);
문서를 만드는 방법을 보여주고 HTML 형식으로 지정된 페이지 범위를 저장합니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Initialize OneNote document
Document doc = new Document();
Page page = doc.AppendChildLast(new Page());
// Default style for all text in the document.
ParagraphStyle textStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
page.Title = new Title()
{
TitleText = new RichText() { Text = "Title text.", ParagraphStyle = textStyle },
TitleDate = new RichText() { Text = new DateTime(2011, 11, 11).ToString("D", CultureInfo.InvariantCulture), ParagraphStyle = textStyle },
TitleTime = new RichText() { Text = "12:34", ParagraphStyle = textStyle }
};
// Save into HTML format
dataDir = dataDir + "CreateAndSavePageRange_out.html";
doc.Save(dataDir, new HtmlSaveOptions
{
PageCount = 1,
PageIndex = 0
});
PageIndex
저장하기 위해 첫 페이지의 인덱스를 얻거나 설정합니다. 기본적으로 0입니다.
public int PageIndex { get; set; }
부동산 가치
Examples
png 형식으로 문서를 저장하는 방법을 보여줍니다.
// 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 ImageSaveOptions object
ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png)
{
// Set page index
PageIndex = 1
};
dataDir = dataDir + "ConvertSpecificPageToImage_out.png";
// Save the document as PNG.
oneFile.Save(dataDir, opts);
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);
문서를 만드는 방법을 보여주고 HTML 형식으로 지정된 페이지 범위를 저장합니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Initialize OneNote document
Document doc = new Document();
Page page = doc.AppendChildLast(new Page());
// Default style for all text in the document.
ParagraphStyle textStyle = new ParagraphStyle { FontColor = Color.Black, FontName = "Arial", FontSize = 10 };
page.Title = new Title()
{
TitleText = new RichText() { Text = "Title text.", ParagraphStyle = textStyle },
TitleDate = new RichText() { Text = new DateTime(2011, 11, 11).ToString("D", CultureInfo.InvariantCulture), ParagraphStyle = textStyle },
TitleTime = new RichText() { Text = "12:34", ParagraphStyle = textStyle }
};
// Save into HTML format
dataDir = dataDir + "CreateAndSavePageRange_out.html";
doc.Save(dataDir, new HtmlSaveOptions
{
PageCount = 1,
PageIndex = 0
});
포맷 된 풍부한 텍스트를 가진 문서를 만드는 방법을 보여줍니다.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Create an object of the Document class
Document doc = new Document();
// Initialize Page class object
Page page = new Page();
// Initialize Title class object
Title title = new Title();
// Initialize TextStyle class object and set formatting properties
ParagraphStyle defaultTextStyle = new ParagraphStyle
{
FontColor = Color.Black,
FontName = "Arial",
FontSize = 10
};
RichText titleText = new RichText() { ParagraphStyle = defaultTextStyle }.Append("Title!");
Outline outline = new Outline()
{
VerticalOffset = 100,
HorizontalOffset = 100
};
OutlineElement outlineElem = new OutlineElement();
TextStyle textStyleForHelloWord = new TextStyle
{
FontColor = Color.Red,
FontName = "Arial",
FontSize = 10,
};
TextStyle textStyleForOneNoteWord = new TextStyle
{
FontColor = Color.Green,
FontName = "Calibri",
FontSize = 10,
IsItalic = true,
};
TextStyle textStyleForTextWord = new TextStyle
{
FontColor = Color.Blue,
FontName = "Arial",
FontSize = 15,
IsBold = true,
IsItalic = true,
};
RichText text = new RichText() { ParagraphStyle = defaultTextStyle }
.Append("Hello", textStyleForHelloWord)
.Append(" OneNote", textStyleForOneNoteWord)
.Append(" text", textStyleForTextWord)
.Append("!", TextStyle.Default);
title.TitleText = titleText;
// Set page title
page.Title = title;
// Add RichText node
outlineElem.AppendChildLast(text);
// Add OutlineElement node
outline.AppendChildLast(outlineElem);
// Add Outline node
page.AppendChildLast(outline);
// Add Page node
doc.AppendChildLast(page);
// Save OneNote document
dataDir = dataDir + "CreateDocWithFormattedRichText_out.one";
doc.Save(dataDir);
SaveFormat
문서가 저장된 형식을 얻습니다.
public SaveFormat SaveFormat { get; }