MCPcopy Create free account
hub / github.com/Tele-AI/doc-ops-mcp / splitTextIntoLines

Method splitTextIntoLines

src/tools/documentConverter.ts:977–992  ·  view source on GitHub ↗

* 将文本分割成适合PDF页面宽度的行

(
    text: string,
    maxWidth: number,
    font: any,
    fontSize: number
  )

Source from the content-addressed store, hash-verified

975 * 将文本分割成适合PDF页面宽度的行
976 */
977 private splitTextIntoLines(
978 text: string,
979 maxWidth: number,
980 font: any,
981 fontSize: number
982 ): string[] {
983 const lines: string[] = [];
984 const paragraphs = text.split('\n');
985
986 for (const paragraph of paragraphs) {
987 const paragraphLines = this.processParagraphForPDF(paragraph, maxWidth, font, fontSize);
988 lines.push(...paragraphLines);
989 }
990
991 return lines;
992 }
993
994 /**
995 * 处理单个段落用于PDF

Callers 1

convertToPDFLegacyMethod · 0.95

Calls 1

Tested by

no test coverage detected