-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
PrintToPDFCommand hangs forever when printing to PDF
public static double cm2inch(double centimeters)
{
return centimeters * 0.393701;
}
PrintToPDFCommand printCommand = new PrintToPDFCommand()
{
MarginTop = 0,
MarginLeft = 0,
MarginRight = 0,
MarginBottom = 0,
PrintBackground = true,
Landscape = false,
PaperWidth = cm2inch(21),
PaperHeight = cm2inch(29.7)
};
System.Console.WriteLine("Printing PDF");
CommandResponse<PrintToPDFCommandResponse> pdf = await chromeSession.SendAsync(printCommand);
System.Console.WriteLine("PDF printed.");
byte[] pdfData = System.Convert.FromBase64String(pdf.Result.Data);
System.IO.File.WriteAllBytes("output.pdf", pdfData);
System.Console.WriteLine("PDF stored");
Metadata
Metadata
Assignees
Labels
No labels