attachment
attachment
attachment
attachment
attachment
attachment

Make a PDF.

Reading File
I'll download the 3 images and combine them into a single PDF.
Running Command

mkdir -p /home/daytona/workspace/pdf-output && cd /home/daytona/workspace/pdf-output && curl -s -o img1.jpg "https://d361swluvexzqs.cloudfront.net/chats-attachments/IMG-20260515-WA0016-1779008257640-sk19dh.jpg" && curl -s -o img2.jpg "https://d361swluvexzqs.cloudfront.net/chats-attachments/IMG-20260517-WA0014-1779008257668-q6qvyy.jpeg" && curl -s -o img3.jpg "https://d361swluvexzqs.cloudfront.net/chats-attachments/IMG-20210224-WA0015-1779008257669-tpir8d.jpg" && ls -lh

Running Command

python3 -c " from PIL import Image from fpdf import FPDF import os output_dir = '/home/daytona/workspace/pdf-output' images = ['img1.jpg', 'img2.jpg', 'img3.jpg'] pdf = FPDF() for img_name in images: img_path = os.path.join(output_dir, img_name) img = Image.open(img_path) w, h = img.size # Convert pixels to mm at 96dpi w_mm = w * 25.4 / 96 h_mm = h * 25.4 / 96 pdf.add_page() pdf.set_margins(0, 0, 0) pdf.image(img_path, x=0, y=0, w=210) # fit to A4 width pdf.output(os.path.join(output_dir, 'output.pdf')) print('Done') "

Running Command

python3 -c " from PIL import Image import os output_dir = '/home/daytona/workspace/pdf-output' images = ['img1.jpg', 'img2.jpg', 'img3.jpg'] imgs = [] for img_name in images: img = Image.open(os.path.join(output_dir, img_name)).convert('RGB') imgs.append(img) imgs[0].save( os.path.join(output_dir, 'output.pdf'), save_all=True, append_images=imgs[1:] ) print('Done') "

Done! Your 3 images have been combined into a single PDF:

output

PDF Document · PDF

The PDF contains:
  • Page 1 — Sale table (monthly GST data)
  • Page 2 — GSTIN label photo
  • Page 3 — PAN card (AAQHA5657P)
This is a shared conversation. Sign in to Orris to start your own chat.