Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion html2pdf4doc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from pathlib import Path

__version__ = "0.0.28"
__version__ = "0.0.29"

PATH_TO_HTML2PDF4DOC_PY = os.path.join(
os.path.dirname(os.path.join(__file__)),
Expand Down
8 changes: 4 additions & 4 deletions html2pdf4doc/html2pdf4doc_js/html2pdf4doc.min.js

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from pypdf import PdfReader

reader = PdfReader("Output/index.pdf")

assert len(reader.pages) == 4, len(reader.pages)

#
# Verify that texts are exactly like expected. This prevents the test from
# passing wrongly on the correct page size but incorrect content.
# Besides other things, this ensures that there is no regression when
# html2pdf4doc prints the whole <body> tag instead the one specified with the
# html2pdf4doc(current)/html2pdf(legacy) attribute.
# NOTE: The replace() calls are needed because of the portability issues.
#

assert (
reader.pages[2].extract_text()
== """\
1. Section 1
Vivamus consectetur mollis varius. Quisque posuere venenatis nulla, sit amet
pulvinar metus vestibulum sed. Sed at libero nec justo leo.
StrictDoc Documentation Test document
3/4
2025-12-21\
"""
), reader.pages[2].extract_text().replace(".StrictDoc", "\nStrictDoc")

assert (
reader.pages[3].extract_text()
== """\
2. Section 2
Lorem ipsum dolor sit amet, c
StrictDoc Documentation Test document
4/4
2025-12-21\
"""
), reader.pages[3].extract_text().replace("cStrictDoc", "c\nStrictDoc")