การบันทึกเอกสารในรูปแบบหน้าถาวร

Contents
[ ]

หลังจากโครงร่างหน้าถูกสร้างขึ้นและรูปทรงเรขาคณิตของวัตถุและตำแหน่งของหน้าจะถูกคำนวณแล้วเอกสารจะถูกบันทึกในรูปแบบหน้าถาวรที่รองรับโดยAspose.Words.

เมื่อบันทึกเอกสารไปยังรูปแบบเพจถาวรอ็อพชันการแสดงผลทั่วไปสำหรับรูปแบบเหล่านี้ทั้ พวกเขาอนุญาตให้มีการควบคุม:

  • จำนวนและช่วงของหน้าที่มีอยู่ในเอกสารออก(PageIndex, PageCount).
  • ความคืบหน้าของการบันทึกเอกสารแบบหน้าต่อหน้า(PageSavingCallback).
  • ชุดของอักขระที่ใช้ในการแสดงผลตัวเลข(NumeralFormat).
  • เครื่องเล่นเมตาไฟล์(MetafileRenderingOptions) สำหรับรายละเอียดเพิ่มเติมโปรดดูที่ การจัดการเมตาไฟล์Windows บทความ.
  • อัตราคุณภาพสำหรับการบีบอัดภาพJPEGค่าที่อาจแตกต่างกันเล็กน้อยขึ้นอยู่กับรูปแบบการบันทึกที่เลือก(JpegQuality).
  • การเพิ่มประสิทธิภาพของกราฟิกแบบเวกเตอร์ในAspose.Wordsเอาท์พุท(OptimizeOutput).
  • เครื่องมือที่ง่ายและสะดวกในการติดตามของความเร็วอินเทอร์เน็ตและการใช้งานข้อมูล(UseAntiAliasing, UseHighQualityRendering).
  • การบันทึกเอกสารเป็นไล่ระดับสีเทา(ColorMode).
  • รูปร่าง(DmlRenderingMode).
  • การสลับระหว่างโหมดการแสดงผลเอฟเฟกต์DML(DmlEffectsRenderingMode).

ตัวอย่างด้านล่างแสดงให้เห็นถึงวิธีการบันทึกเอกสารไปยังรูปแบบJPEGโดยใช้วิธีการSaveและตัวเลื:

For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C
// Open the document.
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Rendering.doc");
// Save as a JPEG image file with default options
System::String outputPathDefault = outputDataDir + u"Rendering.JpegDefaultOptions.jpg";
doc->Save(outputPathDefault);
// Save document to stream as a JPEG with default options
System::SharedPtr<MemoryStream> docStream = new MemoryStream();
doc->Save(docStream, SaveFormat::Jpeg);
// Rewind the stream position back to the beginning, ready for use
docStream->Seek(0, SeekOrigin::Begin);
// Save document to a JPEG image with specified options.
// Render the third page only and set the JPEG quality to 80%
// In this case we need to pass the desired SaveFormat to the ImageSaveOptions constructor
// to signal what type of image to save as.
System::SharedPtr<ImageSaveOptions> options = System::MakeObject<ImageSaveOptions>(SaveFormat::Tiff);
auto pageRange = System::MakeObject<PageRange>(0, 1);
options->set_PageSet(System::MakeObject<PageSet>(System::MakeArray<System::SharedPtr<PageRange>>({ pageRange })));
options->set_JpegQuality(80);
System::String outputPath = outputDataDir + u"Rendering.JpegCustomOptions.jpg";
doc->Save(outputPath, options);