Questions tagged [dinktopdf]

.NET Core P/Invoke wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF

.NET Core P/Invoke wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.

GitHub: https://github.com/rdvojmoc/DinkToPdf

46 questions
8
votes
4 answers

Unable to load External library "libwkhtmltox.dll" while using DinkToPDF for PDF conversion after publishing as app service in azure

I am using DinkToPDF library to convert a html string to it's equivalent PDF. To use this library we have to import a native library provided which is libwkhtmltox.dll. This works fine when I run my .net core project locally,however when I try to…
Swaroop
  • 501
  • 5
  • 18
8
votes
5 answers

DinkToPdf Net Core not able to load DLL files

I am trying to generate PDFs from HTML SQL server database using DinkToPdf library. In the startup file I have added: var context = new CustomAssemblyLoadContext(); context.LoadUnmanagedLibrary(Path.Combine(Directory.GetCurrentDirectory(),…
Joseph Wambura
  • 2,732
  • 2
  • 21
  • 24
7
votes
0 answers

DinkToPdf on Mac M1

I have a problem implementing dinkToPdf NuGet Package in my .NET 6.0 WebAPI application. I'm using macbook with M1 chip. I'm getting the following error: "Unable to load shared library '/Users/vlatkopetrushevski/Desktop/Work/TechUp/Back…
7
votes
5 answers

Separating Page Breaks with DinkToPdf

I have this C# in my Program.cs: var page = "plain"; var slnpath = $@"{Directory.GetCurrentDirectory()}\..\..\..\.."; var htmlpath = $@"{slnpath}\HtmlTemplates\{page}.html"; var pdfpath = $@"{slnpath}\PdfFiles\{page}.pdf"; var…
Matt W
  • 11,753
  • 25
  • 118
  • 215
5
votes
1 answer

Problem with CSS transform and writing-mode properties while converting HTML to PDF dink to pdf

I'm trying to convert html to pdf, it works fine on browser but when I download pdf, css properties, transform and writing mode doesn't work. Here is css code example. I am using dinktopdf c# library. .left-content h2 { color: white; …
Ucha
  • 51
  • 4
5
votes
2 answers

DinkToPDF PDF generation only works once on Azure before giving 502 errors

I've written a PDF generation API that uses dinktopdf to convert some templated HTML to a byte array. This all works fine on my local machine but when I deploy to my azure web application the API only works once. When I try it a second time I get…
user3053470
  • 241
  • 4
  • 9
3
votes
1 answer

DinkToPdf including image in HtmlContent

I have a pdf invoice created using .Net Core 3 Web API and DinkToPdf library. Now I need to insert into pdf an image as signature. I created the Resource folder of my project and add the image with the Copy to Output Directory set to allways. But I…
AlleXyS
  • 2,476
  • 2
  • 17
  • 37
2
votes
1 answer

error MSB3027: Could not copy "/src/libwkhtmltox.dll" to "/app/build/libwkhtmltox.dll"

I am using DinkToPdf to generate pdf document in .net core , it is obligatory to add these files to the project , when I run dotnet build . -c Release -o /app/build in jenkins i get this Error error MSB3027: Could not copy "/src/libwkhtmltox.dll"…
2
votes
1 answer

Adding Custom Code(View) to DinkToPdf header

I am building html views with stringbuilder and using DinkToPDF to convert this HTML to a pdf. I have been able to add a header and footer using the following(By creating static HTML pages: var objectSettings = new ObjectSettings { …
AxleWack
  • 1,801
  • 1
  • 19
  • 51
2
votes
2 answers

Page Break with DinkToPDF

I'm using the DinkToPDF NuGet and I'd like to add a new page break after the first page. Is this possible? I know it would have to be done within the HTML, but providing an element with 100% height does not have the desired effect.
Matt W
  • 11,753
  • 25
  • 118
  • 215
2
votes
2 answers

Processing of Converting the html to PDF takes a lot of time by using DinkToPdf library

Processing of Converting the html to PDF takes a long time by using DinkToPdf library, when this line of code runs: ConverterToPdf.Convert(pdf) How can I solve this problem? public byte[] ConvertReportToPDFAsync() where TViewModel :…
x19
  • 8,277
  • 15
  • 68
  • 126
1
vote
0 answers

Unable to load shared library 'libwkhtmltox' or one of its dependencies

I am using https://github.com/rdvojmoc/DinkToPdf DinkToPDF library to convert a html to PDF. Everything working fine in local environment. But in the dev environment, it throws some errors when converting html to pdf. System.AggregateException: One…
hanushi
  • 1,169
  • 2
  • 12
  • 27
1
vote
0 answers

dinkToPDF is rotating images only when generating PDF File

I am having an issue when generating a PDF File with DInkToPDF where When I upload a jpeg image it is being rendered on the pdf in landscape mode. If I display the image in a image tag directly in my "Edit Form" it renders in the browser in portrait…
BoMerican
  • 118
  • 10
1
vote
2 answers

DinkToPdf Net Core not showing image in docker container

I'm trying to generate PDFs from HTML using DinkToPdf library with docker, but i can't get that showing the image from docker container running, while debugging from windows I have no problems: I have added many libraries to my dockerfile that i…
1
vote
0 answers

Problem with showing images on exporting HTML to pdf in ASP.NET Core

I want to export the database to pdf in the table for each user including their images. the problem is that it shows specific images with height and width. for example, a pic with 359x214 is shown perfectly, But one with 264x364 can't be shown. I…
ahamad zooghi
  • 67
  • 1
  • 8
1
2 3 4