Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.WordsสำหรับJavaอนุญาตให้ผู้ใช้สามารถส่งออกเอกสารหลายหน้าไปยังภาพแรสเตอร์ การแสดงตัวอย่างเก็บถาวรหรือการแสดงภาพของเอกสารสำหรับการใช้งานที่ไม่สามาร.
Aspose.Wordsรองรับการส่งออกหลายหน้าไปยังรูปแบบภาพแรสเตอร์ต่อไปนี้:
คุณลักษณะของการเอ็กซ์ปอร์ตเอกสารหลายหน้าไปยังรูปภาพถูกนำมาใช้โดยใช้คลาสของMultiPageLayout–คุณสามารถระบุวิธีการจัดระเบียบเพจเมื่อบันทึกลงในรูปภาพ:
ตัวอย่างรหัสต่อไปนี้แสดงวิธีการบันทึกเอกสารหลายหน้าDOCXเป็นภาพJPEGที่มีเค้าโครงแนวนอน:
Document doc = new Document("Rendering.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
// Set up Horizontal layout.
options.setPageLayout = MultiPageLayout.Horizontal(10);
doc.save("ImageSaveOptions.HorizontalLayout.jpg", options);
นอกจากนี้คุณยังสามารถปรับแต่งลักษณะที่ปรากฏของเพจไฟล์ที่ส่งออก–ระบุBackColor,BorderColorและBorderWidth.
ตัวอย่างรหัสต่อไปนี้แสดงวิธีการบันทึกเอกสารหลายหน้าDOCXเป็นPNGรูปภาพที่มีเค้าโครงตาราง:
Document doc = new Document("Rendering.docx");
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
// Set up a grid layout with:
// - 3 columns per row.
// - 10pts spacing between pages (horizontal and vertical).
options.setPageLayout(MultiPageLayout.grid(3, 10f, 10f));
// Customize the background and border.
options.getPageLayout().setBackColor(Color.lightGray);
options.getPageLayout().setBorderColor(Color.BLUE);
options.getPageLayout().setBorderWidth(2f);
doc.save("ImageSaveOptions.GridLayout.png", options);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.