Today (2024-10-02) the docs for mutool clean
just doesn't include proper info for this.
mutool clean a.pdf b.pdf 2-N
In the Ubuntu page, there's a better description:
From Ubuntu Man pages:
FROM debian:bookworm | |
# Debian 12 (Bookworm) | |
# MS Fonts | |
ARG MS_FONTS_VERSION=3.8.1 | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
# Custom dependencies | |
# ttf-mscorefonts-installer requires extra setup, adding contrib repo | |
# that might generate conflict with other dependencies |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::MY_BUCKET/*" | |
}, |
services: | |
django: | |
# setup django container ... | |
# Storage | |
minio: | |
image: minio/minio:latest | |
ports: | |
- 9000:9000 | |
- 9001:9001 |
Today (2024-10-02) the docs for mutool clean
just doesn't include proper info for this.
mutool clean a.pdf b.pdf 2-N
In the Ubuntu page, there's a better description:
From Ubuntu Man pages:
# For errors like: | |
# Package 'ttf-mscorefonts-installer' has no installation candidate | |
# You could always do like the entire internet gonna tell you | |
# just add contrib to your /etc/apt/sources.list | |
# example for debian 12 | |
# echo "deb http://deb.debian.org/debian bookworm main contrib" >> /etc/apt/sources.list | |
# But that can mess with your other dependencies | |
# In my case was PrinceXML and it's dependencies. |
wget https://mupdf.com/downloads/archive/mupdf-1.24.9-source.tar.gz -O /mupdf-source.tgz && \ | |
cd / && tar -zxf mupdf-source.tgz && rm mupdf-source.tgz && \ | |
cd /mupdf-1.24.9-source && make HAVE_X11=no HAVE_GLUT=no prefix=/usr install && \ | |
rm -rf /mupdf-1.24.9-source /var/lib/apt/lists/* |
from dataclasses import dataclass | |
import pymupdf | |
@dataclass | |
class Margin: | |
"""Margin in points | |
1 inch = 72 points | |
1 cm = 28.35 points |
class ScheduleInlineFormSet(BaseInlineFormSet): | |
def add_fields(self, form, index): | |
super().add_fields(form, index) | |
# customizing for bootstrap needs | |
if "DELETE" in form.fields: | |
form.fields["DELETE"] = forms.BooleanField( | |
label="Excluir", | |
widget=forms.CheckboxInput(attrs={"class": "btn-check"}), | |
required=False, | |
) |
# this dict can be accessed in get_context() | |
{ | |
"widget": { | |
"name": "publishing_dates", | |
"is_hidden": False, | |
"required": False, | |
"value": "[datetime.date(2024, 9, 5), datetime.date(2024, 9, 6), datetime.date(2024, 9, 7), datetime.date(2024, 9, 8)]", | |
"attrs": { | |
"class": "form-control", | |
"placeholder": "Data de publicação", |
# have all your forms extend this mixin | |
class NoLabelSuffixMixin: | |
def __init__(self, *args, **kwargs): | |
if 'label_suffix' not in kwargs: | |
kwargs['label_suffix'] = '' | |
super(NoLabelSuffixMixin, self).__init__(*args, **kwargs) |