Skip to content

Commit

Permalink
- Bug fix when setting cache directory
Browse files Browse the repository at this point in the history
- Made property IsChromiumRunning public
  • Loading branch information
Kees committed Oct 16, 2023
1 parent eb8e78f commit 76f8fd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ChromiumHtmlToPdfConsole/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"ChromeHtmlToPdf": {
"commandName": "Project",
"commandLineArgs": "--input \"d:\\test.html\" --output d:\\test.pdf --log-network-traffic --media-load-timeout 15000 --image-resize true --image-load-timeout 15000 --paper-format A4 --sanitize-html"
"commandLineArgs": "--input \"d:\\test.html\" --output d:\\test.pdf --log-network-traffic --media-load-timeout 15000 --image-resize true --image-load-timeout 15000 --paper-format A4 --sanitize-html --disk-cache-directory \"d:\\kees\""
}
}
}
9 changes: 6 additions & 3 deletions ChromiumHtmlToPdfLib/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private string BrowserName
}

/// <summary>
/// Returns the Chromium based browser process id or <c>null</c> when the browser is not running
/// Returns the Chromium based browser process id or <c>null</c> when the browser is not running (anymore)
/// </summary>
public int? ChromiumProcessId
{
Expand All @@ -242,7 +242,7 @@ public int? ChromiumProcessId
/// Returns <c>true</c> when the Chromium based browser is running
/// </summary>
/// <returns></returns>
private bool IsChromiumRunning
public bool IsChromiumRunning
{
get
{
Expand Down Expand Up @@ -493,10 +493,13 @@ private DirectoryInfo GetCacheDirectory
if (!CurrentTempDirectory.Exists)
CurrentTempDirectory.Create();

return CurrentTempDirectory;
return CurrentCacheDirectory;
}
}

/// <summary>
/// <see cref="DocumentHelper"/>
/// </summary>
private DocumentHelper GetDocumentHelper
{
get
Expand Down
4 changes: 0 additions & 4 deletions ChromiumHtmlToPdfLib/Helpers/DocumentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,7 @@ public DocumentHelper(
{
_tempDirectory = tempDirectory;
_useCache = useCache;
#if (DEBUG)
_cacheDirectory = new DirectoryInfo("d:\\");
#else
_cacheDirectory = cacheDirectory;
#endif
_cacheSize = cacheSize;
_webProxy = webProxy;
_instanceId = instanceId;
Expand Down

0 comments on commit 76f8fd7

Please sign in to comment.