import os from reportlab.lib.pagesizes import A4 f...
創建於:2025年12月4日
使用 GPT-5.1 Thinking 回答 Chat01
創建於:2025年12月4日
使用 GPT-5.1 Thinking 回答 Chat01
import os
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, ListFlowable, ListItem
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
output_filename = "Japan_Semiconductor_Report.pdf"
font_name = "TraditionalChinese"
font_found = False
potential_font_paths = [
"/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
"/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc",
"/usr/share/fonts/truetype/noto/NotoSansCJK-Regular.ttc",
"/usr/share/fonts/truetype/wqy/wqy-microhei.ttc",
"/usr/share/fonts/truetype/arphic/uming.ttc",
]
for path in potential_font_paths:
if os.path.exists(path):
try:
pdfmetrics.registerFont(TTFont(font_name, path))
font_found = True
print(f"Using system font: {path}")
break
except Exception as e:
print(f"Failed to load {path}: {e}")
if not font_found:
# Fallback to standard CID font for Traditional Chinese
try:
font_name = "MSung-Light"
pdfmetrics.registerFont(UnicodeCIDFont("MSung-Light"))
print("Using CID font: MSung-Light")
except Exception:
# Final fallback to STSong-Light (Simplified but widely available)
font_name = "STSong-Light"
pdfmetrics.registerFont(UnicodeCIDFont("STSong-Light"))
print("Using CID font: STSong-Light")
styles = getSampleStyleSheet()
styles['Normal'].fontName = font_name
styles['Normal'].fontSize = 10
styles['Normal'].leading = 14
title_style = ParagraphStyle(
'TitleStyle',
parent=styles['Heading1'],
fontName=font_name,
fontSize=18,
leading=22,
alignment=1, # Center
spaceAfter=12
)
h1_style = ParagraphStyle(
'H1Style',
parent=styles['Heading2'],
fontName=font_name,
fontSize=14,
leading=18,
spaceBefore=12,
spaceAfter=6,
textColor=colors.darkblue
)
h2_style = ParagraphStyle(
'H2Style',
parent=styles['Heading3'],
fontName=font_name,
fontSize=12,
leading=16,
spaceBefore=6,
spaceAfter=4,
textColor=colors.black
)
bullet_style = ParagraphStyle(
'BulletStyle',
parent=styles['Normal'],
fontName=font_name,
fontSize=10,
leading=14,
leftIndent=20,
firstLineIndent=-10
)
content_structure = [
{"type": "title", "text": "從半導體預算案看日本半導體產業發展:現況、挑戰與未來展望"},
{"type": "normal", "text": "<b>報告日期:</b>2025/11/22"},
{"type": "normal", "text": "<b>資料來源:</b>綜合整理自 SEAJ, DIGITIMES, Rapidus, 經濟產業省等公開資料"},
{"type": "spacer", "height": 20},
text# Section 1 {"type": "h1", "text": "1. 事件背景與產業發展進程"}, {"type": "h2", "text": "1.1 政策轉向:從短期補救到長期承諾"}, {"type": "bullet", "text": "• <b>預算規模大幅升級:</b>日本執政黨(自民黨)宣布將編列約 <b>1 兆日圓</b> 的正式預算支持半導體與 AI 產業。"}, {"type": "bullet", "text": "• <b>長期戰略化:</b>政策從過去「短期、臨時性」的追加預算(2021-2024 已投入約 5.7 兆日圓),轉變為長期承諾。"}, {"type": "bullet", "text": "• <b>未來承諾:</b>預計自 FY2026 至 FY2030,國家將至少投入 <b>10 兆日圓</b>,重點鎖定半導體生產、研發與生成式 AI。"}, {"type": "h2", "text": "1.2 日本半導體發展的五個階段"}, {"type": "bullet", "text": "• <b>第一階段 (1950-1970):</b>二戰後重建,依賴美國技術授權與通產省(MITI)補貼,建立產業基礎。"}, {"type": "bullet", "text": "• <b>第二階段 (1970-1985):</b>黃金時代,推動 VLSI 計畫。1987 年日本在 DRAM 市佔率曾達 80%,1988 年佔全球半導體產值 50.3%。"}, {"type": "bullet", "text": "• <b>第三階段 (1985-1995):</b>衰退轉折。受美日貿易戰打壓、南韓崛起,以及對 DRAM 的過度技術路徑依賴(忽視邏輯晶片),加上泡沫經濟破裂,導致競爭力下滑。"}, {"type": "bullet", "text": "• <b>第四階段 (1995-2020):</b>轉型期。退出通用 DRAM 市場,轉攻利基型晶片(CIS, MCU)與上游材料設備,確立了在供應鏈上游的壟斷地位。"}, {"type": "bullet", "text": "• <b>第五階段 (2020-2025 至今):</b>戰略重啟。推動「半導體復興」,透過引進台積電(JASM)、成立 Rapidus 以及強化美日同盟,試圖重掌製造端話語權。"}, # Section 2 {"type": "h1", "text": "2. 日本半導體業發展現況:強項與痛點"}, {"type": "h2", "text": "2.1 產業鏈結構:啞鈴型發展"}, {"type": "bullet", "text": "• <b>上游材料(Materials):</b>全球市佔率約 <b>50%</b>,在矽晶圓(信越、勝高)、光阻劑(JSR, TOK)、化學品等領域擁有絕對優勢。"}, {"type": "bullet", "text": "• <b>上游設備(Equipment):</b>全球市佔率約 <b>30%</b>,僅次於美國。TEL、SCREEN、Advantest 均為龍頭。"}, {"type": "bullet", "text": "• <b>中游製造(Manufacturing):</b>嚴重缺失。全球晶圓代工市佔僅剩 <b>3.7%</b>,且多停留在 40nm 以上的成熟製程。"}, {"type": "h2", "text": "2.2 重啟戰略的驅動因素"}, {"type": "bullet", "text": "• <b>地緣政治風險:</b>美中科技戰暴露了供應鏈的脆弱性,日本意識到過度依賴海外的風險。"}, {"type": "bullet", "text": "• <b>車用晶片荒的教訓:</b>疫情期間 MCU 短缺重創 Toyota 等車廠,迫使日本建立具韌性的本土供應鏈。"}, {"type": "bullet", "text": "• <b>美日同盟:</b>美國將日本視為印太地區的半導體戰略夥伴,希望日本成為「安全可靠的供應鏈核心」。"}, # Section 3 {"type": "h1", "text": "3. 日本半導體捲土重來:Rapidus 的豪賭"}, {"type": "h2", "text": "3.1 Rapidus 的定位與策略"}, {"type": "bullet", "text": "• <b>國家級平台:</b>由政府主導,八大企業出資,與 IBM 及 IMEC 合作。"}, {"type": "bullet", "text": "• <b>目標市場:</b>鎖定 AI、量子計算、HPC 等後摩爾時代的利基市場,不與台積電爭奪手機 SoC 大眾市場。"}, {"type": "bullet", "text": "• <b>商業模式 — RUMS:</b>採取「快速與統一製造服務」,整合設計與製造。導入<b>單晶圓處理</b>技術,可將交期縮短 60%。"}, {"type": "h2", "text": "3.2 面臨的巨大挑戰"}, {"type": "bullet", "text": "• <b>技術落差:</b>良率仍低,且缺乏 EUV 量產經驗,整體成熟度落後對手至少兩年。"}, {"type": "bullet", "text": "• <b>資本懸殊:</b>研發團隊與資金規模遠遜於台積電與三星。Rapidus 依賴政府補助,對手則有龐大資本支出。"}, {"type": "bullet", "text": "• <b>成本結構:</b>試產晶圓成本高昂,初期僅能應用於對價格不敏感的領域(如軍用、高階研發)。"}, {"type": "bullet", "text": "• <b>產能限制:</b>北海道千歲廠僅為試產線,產能不足以應對大規模量產需求。"}, # Section 4 {"type": "h1", "text": "4. 未來展望:三箭齊發的戰略佈局"}, {"type": "h2", "text": "4.1 上游:鞏固材料與設備霸權"}, {"type": "bullet", "text": "• 受惠於台積電 2nm 投資及全球 HBM/AI 伺服器需求,日本半導體材料預計在 2025-2027 年將維持 <b>50%</b> 的全球市佔率。"}, {"type": "bullet", "text": "• 半導體設備營收年複合成長率 (CAGR) 預估為 4.9%。"}, {"type": "h2", "text": "4.2 中游(成熟與記憶體):引入外援建立防線"}, {"type": "bullet", "text": "• <b>邏輯晶片 — JASM (台積電熊本廠):</b>一廠量產 12-28nm 供應 Sony/車用;二廠預計 2027 年推進至 6/7nm,拉升至中階先進製程。"}, {"type": "bullet", "text": "• <b>記憶體 — 美光 (Micron):</b>政府補助美光在廣島設廠,計畫 2027 年投產 1-Gamma DRAM 與 HBM,確保記憶體供應安全。"}, {"type": "h2", "text": "4.3 中游(尖端客製化):Rapidus 的藍海策略"}, {"type": "bullet", "text": "• 專注於「小規模、高度客製化」市場,接受少量多樣訂單以建立生態系。"}, {"type": "bullet", "text": "• 開發 600mm 面板級封裝與 3D 堆疊技術,在封裝端創造差異化優勢。"}, # Section 5 {"type": "h1", "text": "5. 結論"}, {"type": "bullet", "text": "• <b>基石穩固:</b>材料與設備仍是日本最強大的底氣,在全球供應鏈中不可或缺。"}, {"type": "bullet", "text": "• <b>現實妥協:</b>針對成熟製程與記憶體,日本選擇引進台積電與美光,以最快速度補足供應鏈斷層。"}, {"type": "bullet", "text": "• <b>未來賭注:</b>Rapidus 承載了日本技術自主的夢想,雖然挑戰巨大,但為 AI 與後摩爾時代的發展保留了火種。"},
]
story = []
for item in content_structure:
if item["type"] == "title":
story.append(Paragraph(item["text"], title_style))
elif item["type"] == "normal":
story.append(Paragraph(item["text"], styles['Normal']))
elif item["type"] == "h1":
story.append(Paragraph(item["text"], h1_style))
elif item["type"] == "h2":
story.append(Paragraph(item["text"], h2_style))
elif item["type"] == "bullet":
story.append(Paragraph(item["text"], bullet_style))
elif item["type"] == "spacer":
story.append(Spacer(1, item["height"]))
doc = SimpleDocTemplate(output_filename, pagesize=A4,
rightMargin=72, leftMargin=72,
topMargin=72, bottomMargin=72)
doc.build(story)
output_filename
我已經幫你跑完這段程式,PDF 已經生成好了 ✅
你可以在這裡下載:
[Download Japan_Semiconductor_Report.pdf]
如果你之後想加目錄、頁碼或公司 logo,我也可以幫你把程式再優化一版。