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
   {
      Docx,        // <-- no changes here
      Pdf,         // <-- no changes here
      FlatOpcml,  // <-- no changes here
      Dot,         // <-- no changes here
      Rtf,         // <-- no changes here
      Text,        // <-- no changes here
      Html,        // <-- no changes here
      Mhtml       // <-- no changes here
   }

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.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveWithDefaultSettings_out.pdf";
   oneFile.Save(dataDir, SaveFormat.Pdf);

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToJpegImageUsingSaveFormat_out.jpg";
   oneFile.Save(dataDir, SaveFormat.Jpeg);

Mostra come salvare un documento in formato gif.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToImageDefaultOptions_out.gif";
   oneFile.Save(dataDir, SaveFormat.Gif);

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += @"\SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions { Quality = 100 }.WithFormat(SaveFormat.Jpeg));

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBmpImageUsingImageSaveOptions_out.bmp";
   oneFile.Save(dataDir, new ImageSaveOptions { SaveFormat = SaveFormat.Bmp });

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += "SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions { Resolution = 220, SaveFormat = SaveFormat.Jpeg });

Mostra come salvare un documento come immagine di grayscale.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveAsGrayscaleImage_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions { SaveFormat = SaveFormat.Png, ColorMode = ColorMode.GrayScale });

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingPackBitsCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                 {
                     TiffCompression = TiffCompression.PackBits
                 });

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingJpegCompression.tiff");
   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.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
   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.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += @"\SaveToBinaryImageUsingOtsuMethod_out.png";
   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.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingFixedThreshold_out.png";
   oneFile.Save(dataDir,
                  new ImageSaveOptions(SaveFormat.Png)
                  {
                      ColorMode = ColorMode.BlackAndWhite,
                      BinarizationOptions = new ImageBinarizationOptions()
                      {
                          BinarizationMethod = BinarizationMethod.FixedThreshold,
                          BinarizationThreshold = 123
                      }
                  });
 Italiano