rdvojmoc / DinkToPdf

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
MIT License
1.09k stars 417 forks source link

Change format Size #99

Closed solopromiguel closed 4 years ago

solopromiguel commented 4 years ago

I need to define the height and width of the PDF output, with predefined values, is this possible? Example: --page-width 70mm --page-height 320mm

var globalSettings = new GlobalSettings
                {
                    ColorMode = ColorMode.Color,
                    Orientation = Orientation.Portrait,
                  //  PaperSize = PaperKind.A4,
                    Margins = new MarginSettings { Top = 10 },
                    DocumentTitle = "PDF Report",
                    Out = Path.Combine(filePath, "file.pdf")
                };
solopromiguel commented 4 years ago

PaperSize = new PechkinPaperSize ("70mm", "30cm"),