Giter Site home page Giter Site logo

go-wkhtmltox's People

Contributors

sysadmind avatar xujinzheng 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  avatar

Watchers

 avatar  avatar  avatar

go-wkhtmltox's Issues

CORS/Restrict external access

Hello again,

Is it possible it implement any access control to the service? Such as CORS?
For example only let requests from http://www.example.com execute conversions?

Access-Control-Allow-Origin: http://www.example.com

Bit of a Docker beginner...

Quality not appended in ToImageOptions

I'm new to Go so I'm gessing, but it seems quality is not added to args in ToImageOptions.

The fact is that calling the API as README suggest doesn't work as espected:

{
    "to" : "image",
    "converter":{
      "format" : "png",
      "quality": "0",
      "uri": "https://sbit.io"
      
    },
  "template": "binary"
  }

But calling the API with extend works:

{
    "to" : "image",
    "converter":{
      "format" : "png",
      "extend": {"quality": "0" },
      "uri": "https://sbit.io"
      
    },
  "template": "binary"
  }

Please note that 0 is a must param for PNG images as indicated in wkhtmltopdf/wkhtmltopdf#2608

/cc @jonhattan @facine

How to access wkhtmltopdf Global Options?

Is this possible through the API? If so an example would be much appreciated :)

Essentially I would like to be able to pass the --javascript-delay option for fetching slower or javascript-based sites.

Cheers

Issue in converting html to pdf

I am using go-wkhtmltox package as a library instead of a service. I currently see issues when I try to convert html to pdf (html to image is working fine).

Sample Code

htmlToX, err := wkhtmltox.New(conf)
fetcherOpts := wkhtmltox.FetcherOptions{}

var convertOpts wkhtmltox.ConvertOptions
convertOpts = &wkhtmltox.ToPDFOptions{URI: "https://google.com"}

convData, err := htmlToX.Convert(fetcherOpts, convertOpts)

Error Details

open /var/folders/yb/xxxx/T/go-wkhtmltox539727929/79b4072e-e3ee-49a0-997d-e86ce49ab687.pdf: no such file or directory. The error points to this line in the codebase.

Any idea on why the error is thrown? or am I missing something?

More verbose output?

Any way to get more verbose output? Would be nice to see the standard out logged somewhere?

How to escape space in GlobalOptions

Hi,
I use https://github.com/idocking/go-wkhtmltox docker container with wkhtmltopdf 0.12.5 (with patched qt).
I try to set GlobalOptions like this:

"converter": {
		"url": null,
		"extend": {
			"footer-left": "[date]",
			"footer-right": "Prepared [date] [page]/[topage]",
			"footer-font-size": "10",
			"margin-bottom": "20",
			"footer-spacing": "10"
		}
	},

I use space like in footer-right line I get error when convert to pdf:

open /tmp/go-wkhtmltox212187195/41f80aa7-be68-4437-9d43-27bb8f520780.pdf: no such file or directory

When I delete space in string line this "Prepared[date][page]/[topage]" everything work fine.

Any ideas how to escape space?

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.