Sicos1977 / ChromiumHtmlToPdf

Convert HTML to PDF with a Chromium based browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConvertToPdf get stuck with portable chrome

kadyrkulovr opened this issue · comments

When I use the portable chrome, the method ConvertToPdf gets stuck (never ends). No errors except informational logs (see screenshot).

Any ideas on how to solve this? Thanks.

I downloaded chrome from https://portableapps.com/apps/internet/google_chrome_portable

Platform: Windows 10
Version: 2.6.7

code:
image

log details:
image

I also tried your console application with portable chrome and it stuck in this line:
image

Ok, to solve this we need to specify the userProfile parameter in the Converter constructor.

var chromeFilePath = AppContext.BaseDirectory + "GoogleChromePortable\\chrome.exe";
var chromeProfilePath = AppContext.BaseDirectory + "GoogleChromePortable\\Data\\profile";

using var converter = new Converter(
    chromeExeFileName: chromeFilePath, 
    userProfile: chromeProfilePath, 
    logger: _logger);

@Sicos1977 Quick question.
Have you noticed that the portable version works slower than the installed one?
For example:
installed chrome: 500KB file takes 3400-3700ms
portable chrome: 500KB file takes 5000-6000ms

commented

I never have done any comparissons between the 2 version so I don't know.