Hiçbir şey Yazdırılacak Değilken Boş Sayfa Çıktısı
Olası Kullanım Senaryoları
Eğer sayfa boşsa, Aspose.Cells çalışma sayfasını resme dökerken hiçbir şeyi yazdırmaz. Bu davranışı ImageOrPrintOptions.OutputBlankPageWhenNothingToPrint özelliğini kullanarak değiştirebilirsiniz. true olarak ayarladığınızda, boş sayfayı yazdıracaktır.
Hiçbir şey Yazdırılacak Değilken Boş Sayfa Çıktısı
Aşağıdaki örnek kod, boş bir çalışma kitabı oluşturur ve boş çalışma sayfasını true olarak ayarladıktan sonra resme döker. Sonuç olarak, hiçbir şeyi yazdıracak bir boş sayfa oluşturur ve bu sayfayı aşağıdaki resimde görebilirsiniz.
Örnek Kod
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Output directory | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
//Create workbook | |
Workbook wb = new Workbook(); | |
//Access first worksheet - it is empty sheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Specify image or print options | |
//Since the sheet is blank, we will set OutputBlankPageWhenNothingToPrint to true | |
//So that empty page gets printed | |
ImageOrPrintOptions opts = new ImageOrPrintOptions(); | |
opts.ImageType = Drawing.ImageType.Png; | |
opts.OutputBlankPageWhenNothingToPrint = true; | |
//Render empty sheet to png image | |
SheetRender sr = new SheetRender(ws, opts); | |
sr.ToImage(0, outputDir + "OutputBlankPageWhenNothingToPrint.png"); |