简体   繁体   English

如何使用barryvdh / dompdf在已上传的PDF中添加标题

[英]How to add header in an uploaded PDF using barryvdh/dompdf

I am using barryvdh/dompdf in my project to deal with pdfs. 我在我的项目中使用barryvdh / dompdf处理pdf。 Yes as you are thinking with php and Laravel. 是的,因为您正在考虑使用php和Laravel。

In backend, I have a form which uploads a pdf and from the frontend we can download it. 在后端,我有一个上载pdf的表格,我们可以从前端下载pdf。
This functionality is working perfectly. 此功能运行良好。

But now I want to add a header in that uploaded pdf to add my project's name. 但是现在我想在该上传的pdf文件中添加标题,以添加我的项目名称。

I have worked with pdf generation by this package so I know how this package works but I can't find anything about editing a pdf. 我已经通过该软件包进行了pdf生成,因此我知道该软件包的工作原理,但是我找不到有关编辑pdf的任何信息。
I have been doing some research on google but can't find anything related to my problem. 我一直在谷歌上做一些研究,但找不到任何与我的问题有关的东西。

I haven't done anything so far related to this so I have no more details or code to show but to clear confusion let me just show you the points you need to keep in mind and forget anything you read till now. 到目前为止,我还没有做任何与此相关的事情,因此我没有更多细节或代码需要显示,但是为了消除混乱,让我向您展示您需要牢记的要点,而忘记您到目前为止所读的任何内容。

  1. I am using barryvdh/dompdf to deal with pdfs. 我正在使用barryvdh / dompdf处理pdf。
  2. Want to edit a pdf which is uploaded in the system and will be downloaded afterwards. 想要编辑一个已在系统中上传并随后将下载的pdf文件。
  3. I Want to add a header. 我想添加标题。

I just have a mere idea(maybe i am wrong) that it can be done at any of the two stages- 我只是有一个主意(也许我错了),可以在两个阶段中的任何一个阶段完成它-
1. At upload time 1.上载时
2. At download time 2.在下载时

[Note]: Please don't close it as off-topic or duplicate or something similair. [注意]: 请不要关闭它作为离题,重复或类似的东西。 Please do read the whole post before doing anything like that. 请先阅读全文,然后再执行类似的操作。 Because like I said, I have done some research and haven't found anything. 因为就像我说的那样,我已经进行了一些研究,但没有发现任何东西。

This can't be done in DOMPDF. 这无法在DOMPDF中完成。

I guess the solution is to either use native-ish php commands , another package like FPDI or to drop the idea altogether. 我猜解决方案是要么使用本地的php命令 ,另一个像FPDI的软件包, 要么完全放弃这个想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM