Class PdfSaveOptions

Class PdfSaveOptions

Nazwa przestrzeń: Aspose.Note.Saving Zgromadzenie: Aspose.Note.dll (25.4.0)

Pozwala określić dodatkowe opcje podczas renderowania stron dokumentów do PDF.

public sealed class PdfSaveOptions : SaveOptions

Inheritance

object SaveOptions PdfSaveOptions

Dziedziczeni członkowie

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

Pokaż, jak przechowywać dokument w formacie PDF z rozmieszczeniem strony litery.

// 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 });

Pokaż, jak zapisać dokument w formacie PDF z rozmieszczeniem strony A4 bez ograniczeń wysokości.

// 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 });

Pokaż, jak zapisać notebook w formacie PDF z określonymi opcjami.

// 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);

Kiedy długie strony OneNote są przechowywane w formacie pdf, są podzielone na strony. próbka pokazuje, jak skonfigurować logikę podziału obiektów znajdujących się na przerwach stron.

// 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);

Pokaż, jak zapisać dokument w formacie 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);

Pokaż, jak zapisać dokument w formacie PDF za pomocą określonych ustawień.

// 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);

Kiedy długie strony OneNote są przechowywane w formacie pdf, są podzielone na strony. Przykład pokazuje, jak skonfigurować logikę podziału obiektów znajdujących się na przerwach stron.

// 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

Otrzymuje lub ustawia typ kompresji stosowany do obrazów w pliku PDF.

public PdfImageCompression ImageCompression { get; set; }

Wartość nieruchomości

PdfImageCompression

Examples

Pokaż, jak zapisać dokument w formacie PDF za pomocą określonych ustawień.

// 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

Otrzymuje lub ustawia wartość określającą jakość obrazów JPEG w dokumencie PDF.Wartość może się różnić od 0 do 100, gdzie 0 oznacza najgorszą jakość, ale maksymalną kompresję, a 100 oznacza najlepszą jakość ale minimalną.

public int JpegQuality { get; set; }

Wartość nieruchomości

int

Examples

Pokaż, jak zapisać dokument w formacie PDF za pomocą określonych ustawień.

// 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

Wartość zwykła wynosi 90.

PageSettings

Otrzymuje lub ustawia ustawienia strony dla każdej strony w dokumencie.Zgodnie ze standardem zależne jest od CurrentUICulture, *Kultury USA mają ustawienia litery, inne mają A4.

public PageSettings PageSettings { get; set; }

Wartość nieruchomości

PageSettings

Examples

Pokaż, jak przechowywać dokument w formacie PDF z rozmieszczeniem strony litery.

// 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 });

Pokaż, jak zapisać dokument w formacie PDF z rozmieszczeniem strony A4 bez ograniczeń wysokości.

// 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

Dostęp lub ustaw algorytm używany do podziału stron.

public PageSplittingAlgorithm PageSplittingAlgorithm { get; set; }

Wartość nieruchomości

PageSplittingAlgorithm

Examples

Pokaż, jak zapisać notebook w formacie PDF z określonymi opcjami.

// 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);

Kiedy długie strony OneNote są przechowywane w formacie pdf, są podzielone na strony. próbka pokazuje, jak skonfigurować logikę podziału obiektów znajdujących się na przerwach stron.

// 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);

Kiedy długie strony OneNote są przechowywane w formacie pdf, są podzielone na strony. Przykład pokazuje, jak skonfigurować logikę podziału obiektów znajdujących się na przerwach stron.

// 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);
 Polski