php 使用 mPDF 将 PDF 文件保存到目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12054343/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 02:43:17  来源:igfitidea点击:

save a PDF file to a directory using mPDF

phpmpdf

提问by umasachin

I have a question regarding the PDF files.I have written the code in order to open a PDF, i manage to output the context in the browser but i want also this PDF file to be saved in a directory.

我有一个关于 PDF 文件的问题。我编写了代码以打开 PDF,我设法在浏览器中输出上下文,但我也希望将此 PDF 文件保存在一个目录中。

Does anyone know how i will do it?

有谁知道我会怎么做?

I can post the code if you think this will be helpful for you.

如果您认为这对您有帮助,我可以发布代码。

Thank you in advance, Sachin

提前谢谢你,萨钦

回答by Djave

Quote from stackoverflow:

引用来自stackoverflow

Docs state that the first argument of Output() is the file path, second is the savng mode - you need to set it to 'F'.

文档说明 Output() 的第一个参数是文件路径,第二个参数是 savng 模式 - 您需要将其设置为“F”。

$mpdf->Output('filename.pdf','F');