Coder Social home page Coder Social logo

htmltopdfcore's People

Contributors

carloscds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

htmltopdfcore's Issues

Wkhtmltopdf.NetCore.dll: 'Permission denied'

How to resolve this error ?

Exception has occurred: CLR/System.ComponentModel.Win32Exception
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in Wkhtmltopdf.NetCore.dll: 'Permission denied'
at Wkhtmltopdf.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html)
at Wkhtmltopdf.NetCore.HtmlAsPdf.GetPDF(String html)
at HtmlToPDFCore.HtmlToPDF.ReturnPDF(String html)
at create_file_pdf.Program.GeneratePdfReport(IEnumerable`1 eventList) in /Users/niciuse/Desktop/work/create-file-pdf/Program.cs:line 27
at create_file_pdf.Program.Main(String[] args) in /Users/niciuse/Desktop/work/create-file-pdf/Program.cs:line 17

Pipe is broken on AWS Lambda

I am able to run this successfully in my local environment(Windows as well as Linux) but when I deploy it to AWS Lambda, I am getting "Pipe is broken" error. Is there any workaround for Lambda?

"error":"Permission denied"

First of all thanks for your Package!
I hosted your package on a debian Server + REST API, when i call my PDF Function the request is always "error":"Permission denied".
I forget some settings?

[HttpGet]
[Route("identificationPdf/{shippingId}")]
public IActionResult IdentificationPdf(int shippingId)
{
var shipping = _shippingService.GetById(shippingId);

        HtmlToPdf pdf = new HtmlToPdf();
        string markSheet = string.Empty;
        markSheet = System.IO.File.ReadAllText("Helper/IdentificationPdf.html");
		markSheet = markSheet.Replace("ShippingGoods", shipping.ShippingGoods)
		  .Replace("IdentificationNumber", shipping.IdentificationNumber)
		  .ToString();
		var htmlToPdf = new HtmlToPDFCore.HtmlToPDF();
		var bytes = htmlToPdf.ReturnPDF(markSheet);
		return File(bytes, "application/pdf", "Versandgut/Versand#"+ shipping.Id + ".pdf");
    }

	private byte[] ReturnPDF(string html)
	{
		var dir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
		dir = Path.Combine(dir, "rotativa");
		Wkhtmltopdf.NetCore.RotativaConfiguration.RotativaPath = dir;
		Wkhtmltopdf.NetCore.RotativaConfiguration.IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
		var pdf = new Wkhtmltopdf.NetCore.HtmlAsPdf();
		var buffer = pdf.GetPDF(html);
		return buffer;
	}

thats everything what I implemented.

Probably you have a idea. BR Max :)

Disabling smart shrinking

Thanks for the simple and nice library.
Is there any option to disable smart shrinking? Pdf looks ok but the problem is that there is some useless empty space and not fill
A4 page.

Issue Testing Nuget

Hi, Thank you for working on a tool like this. I am writing to see if you could help me out solve this problem.

I am running the solution as shown in the example in a .NET Core 2.2 in Mac OS.
I am getting this Broken Pipe Error.

Is there something special that I should do?

{System.IO.IOException: Broken pipe
at System.IO.FileStream.WriteNative(ReadOnlySpan1 source) at System.IO.FileStream.FlushWriteBuffer() at System.IO.FileStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at Wkhtmltopdf.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html) at HTML2PDF.Program.Main(String[] args) in /Users/jmarti/projects/HTML2PDF/HTML2PDF/Program.cs:line 17} Data: {System.Collections.ListDictionaryInternal} HResult: 32 HelpLink: (null) InnerException: (null) Message: "Broken pipe" Source: "System.Private.CoreLib" StackTrace: " at System.IO.FileStream.WriteNative(ReadOnlySpan1 source)\n at System.IO.FileStream.FlushWriteBuffer()\n at System.IO.FileStream.Dispose(Boolean disposing)\n at System.IO.Stream.Close()\n at System.IO.StreamWriter.Dispose(Boolean disposing)\n at System.IO.TextWriter.Dispose()\n at Wkhtmltopdf.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html)\n at HTML2PDF.Program.Main(String[] args) in /Users/jmarti/projects/HTML2PDF/HTML2PDF/Program.cs:line 17"
TargetSite: {Void WriteNative(System.ReadOnlySpan`1[System.Byte])}
Static members:
Non-Public members:

Uso do código

Olá, boa noite.
Estou trabalhando na geração de um PDF que é alimentado por duas models. É um PDF que deve conter informações do paciente, médico e resultados dos exames.

Gostaria de saber como poderia usar esse código disponibilizado por você na minha aplicação. Teria que importar tudo para junto do meu projeto?

CSS

Como faço pra utilizar css??

Resource links

Hi,

Had a quick play around, seems conversion of relative reference URLs to absolute references isn't supported by the converter.

I.e.: "../img/jjw_logo_transparent.png" or for sake of Mvc "~/img/jjw_logo_transparent.png"

If this is doable and could be added it would be a massive, massive help.

Thanks!

package size issue

lambda need : your unzipped package size has to be less than 250MB (262144000 bytes).

Run the error report in docker...

Exception: /app/rotativa/Linux/wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory

Boleto NetCore 7

Pessoal, estou fazendo um projeto para implantação de boleto e estou utilizando esse projeto aqui.
Sabem me dizer se roda tranquilo para o .NET 7?

How to set margin

First of all, I'm very thank you to you share like that a library with us. I want to know how can we set margin of the pdf page. If you provide a solution to me I will be very happy. Thanks for your interest. If there's any donation link I would glad to be send an amount which I can afford.

Positioning

Hi again,

Is CSS positioning supported because no matter what I do I can't seem to get inline elements to work?

I've tried grids which can display elements in columns but not in-line and inline positioning but then the space between the elements is lost.

Inline:
HTML
image
PDF
image

Grid
HTML
image
PDF
image

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.