diff --git a/babeldoc/converter.py b/babeldoc/converter.py index b5840782..6a119f42 100644 --- a/babeldoc/converter.py +++ b/babeldoc/converter.py @@ -506,6 +506,7 @@ def vflag(font: str, char: str): # 匹配公式(和角标)字体 self.il_creater.on_pdf_figure(child) pass elif isinstance(child, LTLine): # 线条 + self.il_creater.on_ltline(child) continue layout = self.layout[ltpage.pageid] # ltpage.height 可能是 fig 里面的高度,这里统一用 layout.shape @@ -518,8 +519,10 @@ def vflag(font: str, char: str): # 匹配公式(和角标)字体 else: # 全局线条 lstk.append(child) elif isinstance(child, LTCurve): + self.il_creater.on_ltcurve(child) pass elif isinstance(child, LTRect): + self.il_creater.on_ltrect(child) pass else: pass diff --git a/babeldoc/document_il/frontend/il_creater.py b/babeldoc/document_il/frontend/il_creater.py index 7e132fa8..c05f5466 100644 --- a/babeldoc/document_il/frontend/il_creater.py +++ b/babeldoc/document_il/frontend/il_creater.py @@ -5,7 +5,10 @@ import pdfminer.pdfinterp import pymupdf from pdfminer.layout import LTChar +from pdfminer.layout import LTCurve from pdfminer.layout import LTFigure +from pdfminer.layout import LTLine +from pdfminer.layout import LTRect from pdfminer.pdffont import PDFCIDFont from pdfminer.pdffont import PDFFont from pdfminer.psparser import PSLiteral @@ -353,3 +356,12 @@ def on_pdf_figure(self, figure: LTFigure): figure.bbox[3], ) self.current_page.pdf_figure.append(il_version_1.PdfFigure(box=box)) + + def on_ltline(self, line: LTLine): + pass + + def on_ltcurve(self, curve: LTCurve): + logger.warning("curve is not supported yet") + + def on_ltrect(self, rect: LTRect): + logger.warning("rect is not supported yet")