Enum SaveFormat

Enum SaveFormat

Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)

Chỉ định định dạng trong đó tài liệu được lưu.

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

Nó chỉ ra rằng output là một tệp BMP.

Gif = 4

Nó chỉ ra rằng output là một tệp GIF.

Html = 8

Nó xác định rằng output là một tập tin HTML.

Jpeg = 3

Nó xác định rằng output là một tệp JPEG.

One = 7

Nó chỉ định rằng output là một tệp OneNote.

Pdf = 6

Nó chỉ ra rằng output là một tệp PDF.

Png = 1

Nó chỉ ra rằng output là một tệp PNG.

Tiff = 5

Nó chỉ ra rằng output là một tệp TIFF.

Examples

Hiển thị cách lưu tài liệu bằng cách sử dụng danh sách 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);

Hiển thị cách lưu một tài liệu trong định dạng PDF bằng cách sử dụng cài đặt mặc định.

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

Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng JPEG bằng cách sử dụng SaveFormat.

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

Hiển thị cách lưu tài liệu trong định dạng gif.

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

Hiển thị làm thế nào để thiết lập chất lượng hình ảnh khi lưu tài liệu như một bức ảnh trong định dạng 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));

Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng Bmp bằng cách sử dụng 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 });

Hiển thị làm thế nào để thiết lập độ phân giải hình ảnh khi lưu tài liệu như một bức ảnh.

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

Hiển thị cách lưu một tài liệu như một hình ảnh màu xám.

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

Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng Tiff bằng cách sử dụng nén 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
                 });

Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng Tiff bằng cách sử dụng 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
   });

Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng Tiff bằng cách sử dụng CCITT Group 3 fax compression.

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

Hiển thị cách lưu một tài liệu như một hình ảnh nhị phân bằng cách sử dụng phương pháp của 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,
      }
   });

Hiển thị cách lưu một tài liệu như một hình ảnh nhị phân bằng cách sử dụng giới hạn cố định.

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
                      }
                  });
 Tiếng Việt