pug-pelle-p / pugpdf Goto Github PK
View Code? Open in Web Editor NEWWkHtmlToPdf .net core wrapper
License: Apache License 2.0
WkHtmlToPdf .net core wrapper
License: Apache License 2.0
Exception is thrown when trying to find the executable path to wkhtmltopdf.exe
"Executable not found.":"C:\\Users\\<user>\\.nuget\\packages\\pugpdf.core\\1.0.8\\lib\\netstandard2.0\\wkhtmltopdf\\windows\\x64\\wkhtmltopdf.exe"}
the wkhtmltopdf binaries will be copyed in a wrong folder.
DestinationFiles="$(OutDir)\wkhtmltopdf<plattform><bitness>\wkhtmltopdf" is not ok for AzureFunction.
it must be:
DestinationFiles="$(OutDir)\bin\wkhtmltopdf<plattform><bitness>\wkhtmltopdf"
the start of any azurefunction is "../bin/court4u.AzureFunction.dll"
but the binaries not copyed in the correct bin-folder
do you can fix this? or do you have any workaround?
Hi there,
Is there any interest in extending the wrapper to support the configuration of headers, footers, and a few other switches (such as --lowquality, --print-media-type, and --grayscale)?
If so, I'm happy to submit a pull request.
Cheers
Hello,
I am trying to use a html page and convert it to pdf but it gives an output like multiple lines while it should have been in a single line and ending column’s data gets cut in half if it is too long to fit. Would love any advice.
Regards, Faruk
[16:05:26 INF] Exporting process started....
[16:05:47 ERR] Exception Message = Executable not found.
StackTrace = at PugPdf.Core.WkHtmlToPdfDriver.GetPath()
at PugPdf.Core.WkHtmlToPdfDriver.ConvertAsync(String html, String switches)
at PugPdf.Core.HtmlToPdf.RenderHtmlAsPdfAsync(String html)
When publishing my application with -p:PublishSingleFile=true
the pugpdf library doesn't work, it throws an error when trying to access the assembly location.
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
at System.IO.Path.Combine(String path1, String path2)
According to the documentation Assembly.location
will always return an empty string.
The solution seems to be simple, just change assembly.location
to AppContext.BaseDirectory
.
I'll send a PR with this fix, I made some tests locally and seems to work fine.
Hi.. I am using foreach loop to retrieve list of elements from database. It has multiple rows of data. Well I don't know how can I get this whole list printed on pdf file that I want to generate using this library.
Can anyone help me in this please?
Thanks in advance.
It is not working on linux, tried aloot of things, had to import a new version of wkhtmltopdf that i found on the web and got it working for me.
This repository has "wkhtmltopdf 0.12.4" version and i had to create a docker image with "wkhtmltopdf 0.12.5 (with patched qt)"
Dockerfile
`FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
...
// Install wkhtmltopdf dependencies
RUN apt-get update && apt-get install -y
xvfb
libfontconfig
wkhtmltopdf
libxrender1
libgdiplus
libc6-dev
...
// copy a working linux binary of wkhtmltopdf
// wkhtmltopdf 0.12.5 (with patched qt) -
// this is where i replace your wkhtmltopdf for a latest version
RUN cp newVersionFileForLinux /app/wkhtmltopdf/linux/x64/wkhtmltopdf`
Debugged the code locally and the path of the wkhtmltopdf.exe points to a folder outside the project, "AppData\Local\AzureFunctionsTools\Releases\4.10.1\cli_x64"
It works when you place the executable file there but I could not now where is points when deploying the code to the server
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.