Comments (6)
Hi!, i think you could, without any modification in the library, you could do something like this in the startup
services.AddWkhtmltopdf("PATH_TO_SYSTEM_WIDE_VERSION");
from wkhtmltopdf.netcore-deprecated.
Unfortunately the WkhtmlDriver
class hardcodes an operating system directory to the wkhtmltopdf
path.
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
rotativaLocation = Path.Combine(wkhtmlPath, "Windows", "wkhtmltopdf.exe");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
rotativaLocation = Path.Combine(wkhtmlPath, "Mac", "wkhtmltopdf");
}
else
{
rotativaLocation = Path.Combine(wkhtmlPath, "Linux", "wkhtmltopdf");
}
For example, it is not possible for the binary file to be located under /usr/local/bin/wkhtmltopdf
from wkhtmltopdf.netcore-deprecated.
Yeah, i forgot about those lines, the online way i think it could work is with a few modifications
from wkhtmltopdf.netcore-deprecated.
i think im gonna add a parameter in the setup like "usesystemwide" or something like that....and invoke wkhtmltopdf, the only catch is that the path to wkhtmltopdf will have to be added to the env variable PATH
from wkhtmltopdf.netcore-deprecated.
Also there are line in AddWkhtmltopdf
: RotativaPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, wkhtmltopdfRelativePath);
This can be worked around with setting static variable after the call, but then there are lines as OP described.
I'm planning to implement such feature in my fork. We can collaborate on that. I think user should be able to provide full path to executable, also I suggest removing the static path from settings.
from wkhtmltopdf.netcore-deprecated.
Hi @gurustron! yes, i had planned to do that in the weekend, i have little time available as this moment, if you have the time, please, be my guest
from wkhtmltopdf.netcore-deprecated.
Related Issues (20)
- Failure on .NET 5.0 HOT 18
- Issue when trying to access wkhtmltopdf.exe HOT 1
- GetPdfViewInHtml generate "Razor.RuntimeCompilation.CompilationFailedException" error CS1061 on Centos 8 HOT 1
- Error running under Linux HOT 4
- Injecting dependencies using scope HOT 2
- Error in Linux HOT 2
- Redirect stdin/stdou on linux container
- Missing information on Context in Razor
- Background Image DPI
- header-html using MVC view is not working HOT 1
- 'InvalidOperationException' error when using services.Add Wkhtmltopdf() in ASP.NET Razor project HOT 1
- Not loading Css/Js from my Razor view HOT 1
- Using header with string HTML HOT 1
- ALM Character Shows Near Minus Numbers In Arabic language
- .NET 6 HOT 3
- Footer issue and documentation on using 'default params' HOT 1
- File not found exception on Linux
- Error on run Docker HOT 2
- .NET 6 Docker error on GetPDF() HOT 2
- Font issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wkhtmltopdf.netcore-deprecated.