-
Notifications
You must be signed in to change notification settings - Fork 507
Download Debian Archive
The most recent releases have Debian Archives built on a range of recent Ubuntu releases.
Our Debian archives (*.deb) should be able to be installed on any distribution derived from Debian, by using the apt install command.
Simply:
- Download the
*.debfile from our releases page. - Install it using the command
sudo apt install <<pathToDownloadedDebFile>>(see note below). - Run it... (the executable is located in
/usr/local/binso make sure/usr/local/binis in your PATH).
Our *.deb archives are not self contained, they required a number of additional packages to be installed and properly configured.
The apt install command should install all required packages, however you may need to ensure these packages, such as, Fontconfig, and iconv are properly configured for your needs.
Assuming you have downloaded one of the release *.deb files to your local directory and called it pdf2htmlEX.deb then the correct apt install command would be:
sudo apt install ./pdf2htmlEX.deb
It is very important that you use a (relative or absolute) path to the *.deb file. It is the ./ in front of the pdf2htmlEX.deb file name which tells apt install that it is supposed to install a local file rather than a package name in apt install's internal package database.
Alternatively you could use the following commands:
sudo dpkg -i pdf2htmlEX.deb
apt-get install -f
When page images are stored as WebP in base64 format instead of PNG, the resulting PDF size is significantly reduced. If the images are called externally as WebP instead of embedding them as base64, the size is reduced by approximately 30% more. Below, I’m sharing an example BASH code block that converts PNGs to WebP and embeds the base64-encoded WebP images into all pages.
# Loop through all .png images in the specified directory (bg*.png)
for img in /path/to/your/directory/bg*.png; do
# Extract the image filename without the extension (.png)
img_name=$(basename "$img" .png)
# Convert the .png image to .webp format with quality 75 and save it in the same directory
convert "$img" -quality 75 "/path/to/your/directory/$img_name.webp"
done# Set the folder path variable to the directory containing the images and other files
folder_path="/path/to/your/directory"
# Loop through all .page files in the specified folder
for file in "$folder_path"/*.page; do
# Check if the file is a regular file (not a directory)
if [[ -f "$file" ]]; then
# Extract the src URL of the image in the .page file and replace the .png extension with .webp
x=$(grep -oP 'src="\K[^"]+' $file | sed 's/\.png$//') && x="$x.webp"
# Encode the .webp image file to base64 and save it to encode.txt
base64 /path/to/your/directory/$x > /path/to/your/directory/encode.txt
# Remove any newlines from the base64-encoded content and save to a temporary file
cat /path/to/your/directory/encode.txt | tr -d '\n' > /path/to/your/directory/temp_base64.txt
# Update the .page file to use the .webp extension instead of .png
sed -i 's/\(src="[^"]*\)\.png"/\1.webp"/g' "$file"
# Replace the image src in the .page file with the base64-encoded data URI for the .webp image
awk -v x="$x" 'NR==FNR{base64=$0; next} {gsub(x, "data:image/webp;base64," base64)}1' \
/path/to/your/directory/temp_base64.txt $file \
> /path/to/your/directory/temp.page \
&& mv /path/to/your/directory/temp.page $file
fi
done