Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options set in described methods resulting error #201

Closed
BakuDev opened this issue Dec 2, 2016 · 6 comments
Closed

Options set in described methods resulting error #201

BakuDev opened this issue Dec 2, 2016 · 6 comments

Comments

@BakuDev
Copy link

BakuDev commented Dec 2, 2016

Hi!

Tried to set options directly within called methods as described in docs but seems it's not possible?

$pdf->addCover('cover.html', ['orientation' => 'Portrait']);

Error:

--orientation specified in incorrect location

$pdf->addPage('page1.html', ['encoding' => 'UTF-8']);

Error:

Unknown long argument --charset

And because of above, it's impossible to mix multiple pages of different orientation. Is there any workaround on how to combine pages with different orientation in a single PDF file without using any other software?

@mikehaertl
Copy link
Owner

These are questions about wkhtmltopdf so you should ask there. This here is only a PHP wrapper around it.

If you check wkhtmltopdf -H you see, that orientation is a global option and charset is no option at all. So the error is expected. You can try encoding instead of charset.

@jfcartier
Copy link

I think this thread could be reopen since it's actually resulting error when you try different variables.
ie. ['encoding' => 'UTF-8'] will work, but not ['margin-top' => '100mm']

@mikehaertl
Copy link
Owner

What do you mean by "not work"? Is there an error from wkthmltopdf or is there a problem with the created command string?

@jfcartier
Copy link

@mikehaertl thanks for your quick feedback.
There is my error
Error: --margin-top specified in incorrect location

I searched more about this and I think margin-top is only available as a global variable.
In fact, margin per page seems not quite implanted yet (as seen in this thread).

@mikehaertl
Copy link
Owner

We can't fix this here. Our library is only a wrapper for wkhtmltopdf which does no syntactical checks if your options are at the right place. In other words you need to know how to use wkhtmltopdf to use our library.

@jfcartier
Copy link

Yeah that's what I understood. Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants