public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* When passing the "footer-html" parameter to wkhtmltopdf, an error occurs: HostNotFoundError.
@ 2023-07-28 15:52 yujie zhang
       [not found] ` <6ddb5148-3ebd-4660-b66e-446173fb4e6an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: yujie zhang @ 2023-07-28 15:52 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1502 bytes --]



I am using the PDF engine wkhtmltopdf to convert a given markdown file to 
PDF. When I use --pdf-engine-opt to pass the parameter "footer-html" to 
wkhtmltopdf, I always encounter the following error, regardless of whether 
I include the --enable-local-file-access option or not:
[image: image] 
<https://user-images.githubusercontent.com/19329479/256867710-61c3b08f-8a50-4421-8798-0d4bc49f0a5f.png>

My pandoc command line is as follows, and the input.md file, convert.css 
file, header.html file, and footer.html file involved are all in the same 
directory as pandoc.exe on the local machine.
pandoc --pdf-engine=wkhtmltopdf -s --css=convert.css -f markdown -t pdf 
--pdf-engine-opt="--enable-local-file-access" 
--include-in-header=header.html --variable=margin-top=0in 
--variable=margin-bottom=0.333in --variable=margin-left=0in 
--variable=margin-right=0in --dpi=200 input.md -o test.pdf 
--pdf-engine-opt="footer-html footer.html" 
*Pandoc version: *3.1.6

Also, does anyone know how to add a page number and footer to each 
generated page of the PDF using the wkhtmltopdf engine?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6ddb5148-3ebd-4660-b66e-446173fb4e6an%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3085 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: When passing the "footer-html" parameter to wkhtmltopdf, an error occurs: HostNotFoundError.
       [not found] ` <6ddb5148-3ebd-4660-b66e-446173fb4e6an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-07-28 16:47   ` 'William Lupton' via pandoc-discuss
  0 siblings, 0 replies; 2+ messages in thread
From: 'William Lupton' via pandoc-discuss @ 2023-07-28 16:47 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]

I think you need to separate this into two options (and you need the "--"),
i.e., something like this:

--pdf-engine-opt=--footer-html --pdf-engine-opt=footer.html

I have got page numbers etc. working with wkhtmltopdf. See the extended
help (-H) and look for "Footers And Headers". I modified the example
JavaScript.

However, I am looking to replace wkhtmltopdf with typst. More on this
anon...

On Fri, 28 Jul 2023 at 16:52, yujie zhang <yujiezhang017-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> I am using the PDF engine wkhtmltopdf to convert a given markdown file to
> PDF. When I use --pdf-engine-opt to pass the parameter "footer-html" to
> wkhtmltopdf, I always encounter the following error, regardless of whether
> I include the --enable-local-file-access option or not:
> [image: image]
> <https://user-images.githubusercontent.com/19329479/256867710-61c3b08f-8a50-4421-8798-0d4bc49f0a5f.png>
>
> My pandoc command line is as follows, and the input.md file, convert.css
> file, header.html file, and footer.html file involved are all in the same
> directory as pandoc.exe on the local machine.
> pandoc --pdf-engine=wkhtmltopdf -s --css=convert.css -f markdown -t pdf
> --pdf-engine-opt="--enable-local-file-access"
> --include-in-header=header.html --variable=margin-top=0in
> --variable=margin-bottom=0.333in --variable=margin-left=0in
> --variable=margin-right=0in --dpi=200 input.md -o test.pdf
> --pdf-engine-opt="footer-html footer.html"
> *Pandoc version: *3.1.6
>
> Also, does anyone know how to add a page number and footer to each
> generated page of the PDF using the wkhtmltopdf engine?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/6ddb5148-3ebd-4660-b66e-446173fb4e6an%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/6ddb5148-3ebd-4660-b66e-446173fb4e6an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxgG-5-kNWaBMWWd5X4Pa5wOY7MWpG2zpzMsO_h8k2gwog%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4628 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-28 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 15:52 When passing the "footer-html" parameter to wkhtmltopdf, an error occurs: HostNotFoundError yujie zhang
     [not found] ` <6ddb5148-3ebd-4660-b66e-446173fb4e6an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-28 16:47   ` 'William Lupton' via pandoc-discuss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).