HollowMan6/mdbook-pdf

How to disable cookie on the footer?

YuCao16 opened this issue · 6 comments

This message appears on every page , how can it be removed.
image

Thanks!

I found there is a print.html in folder html, open it with chrome, click Ok, Got it and save as pdf solve my problem.

Hi! Thank you for reporting this. Although there's some way like you said to handle this, I think it would still need to get fixed by our software. I will reopen this issue and investigate that later.

This message appears on every page , how can it be removed. image

Thanks!

Hi @YuCao16 ! Would you please provide the book source code you use that have this issue for me to investigate, or at least your book.toml if it's not open-sourced. Because I can't find any Google analytics js link or code in a normal mdbook generated book, so practically the generated book shouldn't use any cookies. I think you must use some other third-party plugins in this case.

Hi,
Here is the repo and the book.toml as follow:

[book]
authors = ["Martin Geisler"]
language = "en"
multilingual = false
src = "src"
title = "Comprehensive Rust 🦀"

[rust]
edition = "2021"

[build]
extra-watch-dirs = ["po"]

[preprocessor.links]
renderers = ["html"]

[preprocessor.index]
renderers = ["html"]

[preprocessor.svgbob]
renderers = ["html"]
class = "bob"

# Enable this preprocessor to overlay a large red rectangle on the
# pages. This will show you an estimate of what the course
# participants can see during the presentation.
#
[preprocessor.aspect-ratio-helper]
command = "./aspect-ratio-helper.py"

[output.html]
curly-quotes = true
additional-js = ["ga4.js", "speaker-notes.js"]
additional-css = ["svgbob.css", "speaker-notes.css"]
site-url = "/comprehensive-rust/"
git-repository-url = "https://github.com/google/comprehensive-rust"
edit-url-template = "https://github.com/google/comprehensive-rust/edit/main/{path}"

[output.html.fold]
enable = false
level = 0

[output.html.playground]
editable = true

[output.html.redirect]
"structure.html" = "running-the-course/course-structure.html"
"unsafe/unsafe-functions.html" = "calling-unsafe-functions.html"

[output.pdf]
landscape = false
display-header-footer = false
print-background = false
theme = "light"
scale = 1.25
paper-width = 7.07
paper-height = 10
margin-top = 0.4
margin-bottom = 0.4
margin-left = 0.4
margin-right = 0.4
page-ranges = ""
ignore-invalid-page-ranges = false
header-template = "<h3 style='font-size:8px; margin-left: 48%' class='title'></h3>"
footer-template = "<p style='font-size:10px; margin-left: 48%'><span class='pageNumber'></span> / <span class='totalPages'></span></p>"
prefer-css-page-size = true

[output.pdf-outline]
like-wkhtmltopdf = true

Actually, with this book.toml, I'm not able to build the pdf-outline, it throw error: lxml.etree.ParserError: Document is empty (PDF generation is fine).

Actually, with this book.toml, I'm not able to build the pdf-outline, it throw error: lxml.etree.ParserError: Document is empty (PDF generation is fine).

Okay, will investigate that as well, thank you!

Hi! I have fix this cookie issue, but I can't reproduce the pdf-outline issue lxml.etree.ParserError: Document is empty you mentioned, so I don't know what caused your problem. You can check the CI for the generated outline version of the book: https://github.com/HollowMan6/mdbook-pdf/actions/runs/4135358169

Windows_Comprehensive_Rust_PDF.pdf
Linux_Comprehensive_Rust_PDF.pdf
macOS_Comprehensive_Rust_PDF.pdf