-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_complex_pdf.py
More file actions
80 lines (68 loc) · 2.97 KB
/
Copy pathcreate_complex_pdf.py
File metadata and controls
80 lines (68 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
import random
def create_complex_pdf(filename):
c = canvas.Canvas(filename, pagesize=letter)
# Header
c.setFont("Helvetica-Bold", 18)
c.drawString(50, 750, "Qorvo QM77180 (Simulated) Datasheet")
c.setFont("Helvetica", 10)
c.drawString(400, 750, "Preliminary Data - Confidential")
# Text Block (Intro Paragraph)
c.setFont("Helvetica", 10)
intro_text = [
"The QM77180 is a high-performance RF Fusion module designed for 4G/5G mobile devices.",
"It integrates multiple functional blocks including Power Amplifiers (PA), Low Noise ",
"Amplifiers (LNA), and switching networks into a single compact package. The module ",
"supports advanced carrier aggregation and 5G New Radio (NR) bands."
]
y = 720
for line in intro_text:
c.drawString(50, y, line)
y -= 12
# Simulated Image (Block Diagram)
c.setStrokeColorRGB(0.2, 0.2, 0.2)
c.setFillColorRGB(0.9, 0.9, 0.9)
c.rect(50, 580, 250, 100, fill=1) # Main Block
c.setFillColorRGB(0, 0, 0)
c.drawCentredString(175, 630, "[ FUNCTIONAL BLOCK DIAGRAM ]")
c.drawCentredString(175, 615, "(PA + LNA + SWITCH)")
# Key Params (Next to the diagram - mixed layout)
c.setFont("Helvetica-Bold", 11)
c.drawString(320, 670, "Key Specifications")
c.setFont("Helvetica", 10)
c.drawString(320, 650, "• Supported Bands:")
c.drawString(330, 635, " LTE: B1, B3, B5, B7, B20")
c.drawString(330, 620, " 5G: n1, n3, n78, n260")
c.drawString(320, 600, "• LNA Gain: 18.5 dB")
c.drawString(320, 585, "• PAM Bias: 3.6 V")
# MIPI Register Map Table
c.setFont("Helvetica-Bold", 12)
c.drawString(50, 540, "2. MIPI Register Map Configuration")
c.setFont("Courier", 10) # Fixed width for table-like appearance
y = 520
c.drawString(50, y, "Addr | Register Name | Reset | Description")
c.drawString(50, y-10, "-"*65)
registers = [
("0x00", "CHIP_ID", "0x55", "Device Identifier"),
("0x01", "STATUS", "0x00", "Operational Status"),
("0x1C", "PM_TRIG", "0x00", "Power Mode Trigger"),
("0x2A", "PA_BIAS_1", "0x0F", "PA Bias Setting Main"),
("0x2B", "LNA_GAIN", "0x03", "LNA Gain Control"),
("0x30", "BAND_SEL", "0x00", "Band Selection High"),
("0x31", "BAND_SEL", "0x00", "Band Selection Low"),
]
y = 500
for addr, name, rst, desc in registers:
line = f"{addr:<6} | {name:<14} | {rst:<5} | {desc}"
c.drawString(50, y, line)
y -= 15
# Footer paragraph
c.setFont("Helvetica-Oblique", 9)
c.drawString(50, 400, "Note: This document contains proprietary information. All rights reserved by Qorvo (Simulated).")
# Footer
c.drawString(50, 50, "Qorvo Confidential - Do Not Distribute")
c.save()
if __name__ == "__main__":
create_complex_pdf("complex_datasheet.pdf")
print("Created complex_datasheet.pdf")