Error: Conversion failed
huster-songtao opened this issue · comments
Invoice.html.txt
remove .txt
modif code: \ChromeHtmlToPdfConsole\Program.cs
// ChromeHtmlToPdf.exe --input https://www.google.com --output c:\google.pdf
//Options options = null;
//try
//{
// ParseCommandlineParameters(args, out options);
//}
//catch (Exception e)
//{
// Console.WriteLine(e);
//}
Options options = new Options()
{
Input = "Invoice.html",
Output = "Invoice.pdf"
};
2022-07-13T00:38:20.542 - Resetting Chrome arguments to default
2022-07-13T00:38:20.575 - Adding Chrome argument '--headless'
2022-07-13T00:38:20.837 - Adding Chrome argument '--disable-gpu'
2022-07-13T00:38:20.838 - Adding Chrome argument '--hide-scrollbars'
2022-07-13T00:38:20.838 - Adding Chrome argument '--mute-audio'
2022-07-13T00:38:20.838 - Adding Chrome argument '--disable-background-networking'
2022-07-13T00:38:20.838 - Adding Chrome argument '--disable-background-timer-throttling'
2022-07-13T00:38:20.838 - Adding Chrome argument '--disable-default-apps'
2022-07-13T00:38:20.838 - Adding Chrome argument '--disable-extensions'
2022-07-13T00:38:20.839 - Adding Chrome argument '--disable-hang-monitor'
2022-07-13T00:38:20.839 - Adding Chrome argument '--disable-prompt-on-repost'
2022-07-13T00:38:20.839 - Adding Chrome argument '--disable-sync'
2022-07-13T00:38:20.839 - Adding Chrome argument '--disable-translate'
2022-07-13T00:38:20.839 - Adding Chrome argument '--metrics-recording-only'
2022-07-13T00:38:20.839 - Adding Chrome argument '--no-first-run'
2022-07-13T00:38:20.839 - Adding Chrome argument '--disable-crash-reporter'
2022-07-13T00:38:20.850 - Adding Chrome argument '--remote-debugging-port="0"'
2022-07-13T00:38:20.851 - Adding Chrome argument '--window-size="1366,768"'
2022-07-13T00:38:21.096 - Starting Chrome from location 'C:\Program Files\Google\Chrome\Application\chrome.exe' with working directory 'C:\Program Files\Google\Chrome\Application'
2022-07-13T00:38:21.097 - "C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --hide-scrollbars --mute-audio --disable-background-networking --disable-background-timer-throttling --disable-default-apps --disable-extensions --disable-hang-monitor --disable-prompt-on-repost --disable-sync --disable-translate --metrics-recording-only --no-first-run --disable-crash-reporter --remote-debugging-port="0" --window-size="800,600"
2022-07-13T00:38:21.875 - Chrome process started
2022-07-13T00:38:22.411 - Received Chrome error data: 'DevTools listening on ws://127.0.0.1:15740/devtools/browser/65893eaa-c86c-4627-bd3c-6d7da35b90f0'
2022-07-13T00:38:22.413 - Connecting to dev protocol on uri 'ws://127.0.0.1:15740/devtools/browser/65893eaa-c86c-4627-bd3c-6d7da35b90f0'
2022-07-13T00:38:22.450 - Creating new websocket connection to url 'ws://127.0.0.1:15740/devtools/browser/65893eaa-c86c-4627-bd3c-6d7da35b90f0'
2022-07-13T00:38:22.489 - Opening websocket connection with a timeout of 30 seconds
2022-07-13T00:38:22.643 - Websocket opened
2022-07-13T00:38:23.156 - Creating new websocket connection to url 'ws://127.0.0.1:15740/devtools/page/C4C7594421AF0797477EBAF4685DAF9C'
2022-07-13T00:38:23.156 - Opening websocket connection with a timeout of 30 seconds
2022-07-13T00:38:23.174 - Websocket opened
2022-07-13T00:38:23.175 - Connected to dev protocol
2022-07-13T00:38:23.176 - Chrome started
2022-07-13T00:38:23.176 - Loading file C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfConsole\bin\Debug\net6.0\Invoice.html
2022-07-13T00:38:23.180 - Enabling caching
2022-07-13T00:38:23.239 - The 'Page.frameNavigated' event has been fired, waiting for the 'Page.lifecycleEvent' with name 'networkIdle'
2022-07-13T00:38:23.291 - The 'Page.lifecycleEvent' with param name 'DomContentLoaded' has been fired, the dom content is now loaded and parsed, waiting for stylesheets, images and sub frames to finish loading
2022-07-13T00:38:24.235 - The 'Page.lifecycleEvent' event with name 'networkIdle' has been fired, the page is now fully loaded
2022-07-13T00:38:24.239 - File loaded
2022-07-13T00:38:24.239 - Converting to PDF
2022-07-13T00:38:24.245 - An error occurred: 'scale is outside of [0.1 - 2] range'
2022-07-13T00:38:24.322 - Error: Conversion failed
'
2022-07-13T00:38:24.343 - Closing Chrome browser gracefully
2022-07-13T00:38:24.345 - Disposing websocket connection to url 'ws://127.0.0.1:15740/devtools/page/C4C7594421AF0797477EBAF4685DAF9C'
2022-07-13T00:38:24.346 - Closing websocket
2022-07-13T00:38:24.355 - Websocket connection disposed
2022-07-13T00:38:24.355 - Disposing websocket connection to url 'ws://127.0.0.1:15740/devtools/browser/65893eaa-c86c-4627-bd3c-6d7da35b90f0'
2022-07-13T00:38:24.356 - Websocket connection disposed
2022-07-13T00:38:24.395 - Chrome closed gracefully
2022-07-13T00:38:24.472 - [null] - at ChromeHtmlToPdfLib.Browser.PrintToPdf(PageSettings pageSettings, CountdownTimer countdownTimer) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfLib\Browser.cs:line 562
at ChromeHtmlToPdfLib.Converter.Convert(OutputFormat outputFormat, Object input, Stream outputStream, PageSettings pageSettings, String waitForWindowStatus, Int32 waitForWindowsStatusTimeout, Nullable1 conversionTimeout, Nullable
1 mediaLoadTimeout, ILogger logger) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfLib\Converter.cs:line 1285
at ChromeHtmlToPdfLib.Converter.ConvertToPdf(ConvertUri inputUri, Stream outputStream, PageSettings pageSettings, String waitForWindowStatus, Int32 waitForWindowsStatusTimeout, Nullable1 conversionTimeout, Nullable
1 mediaLoadTimeout, ILogger logger) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfLib\Converter.cs:line 1387
at ChromeHtmlToPdfLib.Converter.ConvertToPdf(ConvertUri inputUri, String outputFile, PageSettings pageSettings, String waitForWindowStatus, Int32 waitForWindowsStatusTimeout, Nullable1 conversionTimeout, Nullable
1 mediaLoadTimeout, ILogger logger) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfLib\Converter.cs:line 1439
at ChromeHtmlToPdfConsole.Program.Convert(Options options) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfConsole\Program.cs:line 352
at ChromeHtmlToPdfConsole.Program.Main(String[] args) in C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfConsole\Program.cs:line 141, Conversion failed
C:\Users\Tao\Downloads\ChromeHtmlToPdf-master\ChromeHtmlToPdf-master\ChromeHtmlToPdfConsole\bin\Debug\net6.0\ChromeHtmlT
Somewhere you are providing a scale and this is giving an error --> 2022-07-13T00:38:24.245 - An error occurred: 'scale is outside of [0.1 - 2] range'
No response... closed