Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 FPDF。 我需要每 10 页左右写入磁盘,否则内存会耗尽。 我该怎么做? 我尝试调用输出方法('filename.pdf','F');在一个循环中,这不起作用。 知道它应该是什么样子吗?
您需要查看 FPDF 的来源。我正在使用我认为是 FPDF 的衍生作品的 TFPDF,但功能应该是相同的。
特别有一个功能 _out($s)
function _out($s) { // Add a line to the document if($this->state==2) $this->pages[$this->page] .= $s."\n"; else $this->buffer .= $s."\n"; }
而不是像在这两种情况下那样附加到缓冲区......只需 fwrite 到您选择的打开文件描述符。