Enum SaveFormat

Enum SaveFormat

Il nome: Aspose.Note Assemblea: Aspose.Note.dll (25.4.0)

Indica il formato in cui viene salvato il documento.

public enum SaveFormat

Fields

Bmp = 2

Determinare che la produzione è un file BMP.

Gif = 4

Determinare che la uscita è un file GIF.

Html = 8

Determinare che l’output è un file HTML.

Jpeg = 3

Determinare che la uscita è un file JPEG.

One = 7

Determinare che l’output è un file OneNote.

Pdf = 6

Determinare che l’output è un file PDF.

Png = 1

Indica che la produzione è un file PNG.

Tiff = 5

Determinare che la produzione è un file TIFF.

Examples

Mostra come salvare un documento utilizzando l’elenco SaveFormat.

string inputFile = "Sample1.one";
                                                                     string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
                                                                     string outputFile = "SaveDocToOneNoteFormatUsingSaveFormat_out.one";

                                                                     Document document = new Document(dataDir + inputFile);

                                                                     document.Save(dataDir + outputFile, SaveFormat.One);

Mostra come salvare un documento in formato pdf utilizzando le impostazioni predefinite.

// The path to the documents directory.
                                                                             string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                             // Load the document into Aspose.Note.
                                                                             Document oneFile = new Document(dataDir + "Aspose.one");

                                                                             // Save the document as PDF
                                                                             dataDir = dataDir + "SaveWithDefaultSettings_out.pdf";
                                                                             oneFile.Save(dataDir, SaveFormat.Pdf);

Mostra come salvare un documento come immagine in formato JPEG utilizzando SaveFormat.

// The path to the documents directory.
                                                                                 string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                 // Load the document into Aspose.Note.
                                                                                 Document oneFile = new Document(dataDir + "Aspose.one");

                                                                                 dataDir = dataDir + "SaveToJpegImageUsingSaveFormat_out.jpg";

                                                                                 // Save the document.
                                                                                 oneFile.Save(dataDir, SaveFormat.Jpeg);

Mostra come salvare un documento in formato gif.

// The path to the documents directory.
                                                      string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                      // Load the document into Aspose.Note.
                                                      Document oneFile = new Document(dataDir + "Aspose.one");

                                                      dataDir = dataDir + "SaveToImageDefaultOptions_out.gif";

                                                      // Save the document as gif.
                                                      oneFile.Save(dataDir, SaveFormat.Gif);

Mostra come impostare la qualità dell’immagine quando si salva il documento come immagine in formato JPEG.

// The path to the documents directory.
                                                                                         string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                         // Load the document into Aspose.Note.
                                                                                         Document doc = new Document(dataDir + "Aspose.one");

                                                                                         dataDir = dataDir + "SetOutputImageResolution_out.jpg";

                                                                                         // Save the document.
                                                                                         doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Quality = 100 });

Mostra come salvare un documento come immagine in formato Bmp utilizzando ImageSaveOptions.

// The path to the documents directory.
                                                                                      string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                      // Load the document into Aspose.Note.
                                                                                      Document oneFile = new Document(dataDir + "Aspose.one");

                                                                                      dataDir = dataDir + "SaveToBmpImageUsingImageSaveOptions_out.bmp";

                                                                                      // Save the document.
                                                                                      oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Bmp));

Mostra come impostare una risoluzione dell’immagine quando si salva il documento come immagine.

// The path to the documents directory.
                                                                             string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                             // Load the document into Aspose.Note.
                                                                             Document doc = new Document(dataDir + "Aspose.one");

                                                                             dataDir = dataDir + "SetOutputImageResolution_out.jpg";

                                                                             // Save the document.
                                                                             doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Resolution = 220 });

Mostra come salvare un documento come immagine di grayscale.

// The path to the documents directory.
                                                           string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                           // Load the document into Aspose.Note.
                                                           Document oneFile = new Document(dataDir + "Aspose.one");

                                                           dataDir = dataDir + "SaveAsGrayscaleImage_out.png";

                                                           // Save the document as gif.
                                                           oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                     {
                                                                                         ColorMode = ColorMode.GrayScale
                                                                                     });

Mostra come salvare un documento come immagine in formato Tiff utilizzando la compressione PackBits.

// The path to the documents directory.
                                                                                           string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                           // Load the document into Aspose.Note.
                                                                                           Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));

                                                                                           var dst = Path.Combine(dataDir, "SaveToTiffUsingPackBitsCompression.tiff");

                                                                                           // Save the document.
                                                                                           oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                                                                                                                 {
                                                                                                                     TiffCompression = TiffCompression.PackBits
                                                                                                                 });

Mostra come salvare un documento come immagine in formato Tiff utilizzando la compressione Jpeg.

// The path to the documents directory.
                                                                                       string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                       // Load the document into Aspose.Note.
                                                                                       Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));

                                                                                       var dst = Path.Combine(dataDir, "SaveToTiffUsingJpegCompression.tiff");

                                                                                       // Save the document.
                                                                                       oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                                                                                                             {
                                                                                                                 TiffCompression = TiffCompression.Jpeg,
                                                                                                                 Quality = 93
                                                                                                             });

Mostra come salvare un documento come immagine in formato Tiff utilizzando la compressione di fax CCITT Group 3.

// The path to the documents directory.
                                                                                                    string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                                    // Load the document into Aspose.Note.
                                                                                                    Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));

                                                                                                    var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");

                                                                                                    // Save the document.
                                                                                                    oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                                                                                                                          {
                                                                                                                              ColorMode = ColorMode.BlackAndWhite,
                                                                                                                              TiffCompression = TiffCompression.Ccitt3
                                                                                                                          });

Mostra come salvare un documento come immagine binaria utilizzando il metodo di Otsu.

// The path to the documents directory.
                                                                            string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                            // Load the document into Aspose.Note.
                                                                            Document oneFile = new Document(dataDir + "Aspose.one");

                                                                            dataDir = dataDir + "SaveToBinaryImageUsingOtsuMethod_out.png";

                                                                            // Save the document as gif.
                                                                            oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                                    {
                                                                                                        ColorMode = ColorMode.BlackAndWhite,
                                                                                                        BinarizationOptions = new ImageBinarizationOptions()
                                                                                                                              {
                                                                                                                                  BinarizationMethod = BinarizationMethod.Otsu,
                                                                                                                              }
                                                                                                    });

Mostra come salvare un documento come immagine binaria utilizzando un limite fisso.

// The path to the documents directory.
                                                                              string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                              // Load the document into Aspose.Note.
                                                                              Document oneFile = new Document(dataDir + "Aspose.one");

                                                                              dataDir = dataDir + "SaveToBinaryImageUsingFixedThreshold_out.png";

                                                                              // Save the document as gif.
                                                                              oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                                        {
                                                                                                            ColorMode = ColorMode.BlackAndWhite,
                                                                                                            BinarizationOptions = new ImageBinarizationOptions()
                                                                                                                                      {
                                                                                                                                          BinarizationMethod = BinarizationMethod.FixedThreshold,
                                                                                                                                          BinarizationThreshold = 123
                                                                                                                                      }
                                                                                                        });
 Italiano