(pdf_path: Path, width="100%", height="900px")
| 628 | return None |
| 629 | |
| 630 | def _pdf_to_iframe_html(pdf_path: Path, width="100%", height="900px") -> str: |
| 631 | try: |
| 632 | b = pdf_path.read_bytes() |
| 633 | b64 = base64.b64encode(b).decode("utf-8") |
| 634 | return ( |
| 635 | f"<div style='border:1px solid #ddd;border-radius:8px;overflow:hidden'>" |
| 636 | f"<embed type='application/pdf' width='{width}' height='{height}' src='data:application/pdf;base64,{b64}'></embed>" |
| 637 | f"</div>" |
| 638 | ) |
| 639 | except Exception: |
| 640 | return "" |
| 641 | |
| 642 | def _pdf_to_iframe_file(pdf_path: Path, width="100%", height="900px") -> str: |
| 643 | try: |
no outgoing calls
no test coverage detected