# -*- coding: utf-8 -*-
import io,sys,ssl,urllib.request
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
u="https://d3qi0qp55mx5f5.cloudfront.net/stat/docs/MS_Stats_1-pager_2025.pdf?mtime=1771873605"
req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
data=urllib.request.urlopen(req,timeout=30,context=ctx).read()
open(r"D:\work buddy\2026-11-05-14-15-52\_uch_stats_brochure.pdf","wb").write(data)
print("bytes=",len(data))
try:
    from pypdf import PdfReader
    r=PdfReader(r"D:\work buddy\2026-11-05-14-15-52\_uch_stats_brochure.pdf")
    for p in r.pages:
        print(p.extract_text()[:3000])
except Exception as e:
    print("pypdf err",repr(e))
