public double Height { get; set; }
Page height in inches. Default value is 11.
The DocumentWriterEmptyPage.Width and DocumentWriterEmptyPage.Height properties are used to set the empty page size in inches. The values cannot be 0 when the object is passed to DocumentWriter.AddPage or DocumentWriter.InsertPage.
using Leadtools;using Leadtools.Codecs;using Leadtools.Document.Writer;using Leadtools.Ocr;public void DocumentRasterPageExample(){// Input file namevar inputFileName = Path.Combine(LEAD_VARS.ImagesDir, "TEST.docx");// Output PDF file namevar outputFileName = Path.Combine(LEAD_VARS.ImagesDir, "out_Example.pdf");// Create a new instance of the LEADTOOLS Document Writervar docWriter = new DocumentWriter();// Setup a new RasterCodecs objectusing (var codecs = new RasterCodecs()){codecs.Options.RasterizeDocument.Load.Resolution = 300;// Get information on the pagedouble pageWidth;double pageHeight;using (var info = codecs.GetInformation(inputFileName, false, 1)){// Get the size in inches, we need it for the empty pagepageWidth = info.Document.PageWidth;pageHeight = info.Document.PageHeight;}// Begin the documentdocWriter.BeginDocument(outputFileName, DocumentFormat.Pdf);// Add the first page from SVGvar svgPage = new DocumentWriterSvgPage();using (svgPage.SvgDocument = codecs.LoadSvg(inputFileName, 1, null)){// Add itdocWriter.AddPage(svgPage);}// Add a second page as emptyvar emptyPage = new DocumentWriterEmptyPage();emptyPage.Width = pageWidth;emptyPage.Height = pageHeight;docWriter.AddPage(emptyPage);// Finally, add a third page as an imagevar rasterPage = new DocumentWriterRasterPage();using (rasterPage.Image = codecs.Load(inputFileName, 1)){// Add itdocWriter.AddPage(rasterPage);}}// Finally finish writing the HTML file on diskdocWriter.EndDocument();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";}