简体   繁体   English

通过PHP包含MS Word文件的页眉和页脚

[英]Include header and footer to MS Word file through PHP

header('Content-Type: application/ms word');
header("Content-Disposition: attachment; filename = filename.docx");
header('Content-Transfer-Encoding: binary');
header("Pragma: no-cache");
header("Expires: 0");
header('Cache-Control: must-revalidate');

I used the above code to download a word file with some data from database. 我使用上面的代码从数据库中下载了包含一些数据的word文件。

Now, I want to add a logo and name of the company, page number on each and every page of my file. 现在,我想在文件的每一页上添加公司的徽标和名称,页码。 Ηow should i do it? 我应该这样做吗?

How long did you use Google for? 您使用Google多久了?

Now I'm not sure about PHPDocX , but PHPWord is still quite in its infancy but I think it should be able to handle your problem. 现在我不确定PHPDocX ,但是PHPWord仍处于起步阶段,但我认为它应该能够解决您的问题。

Also, if their github page doesn't work, try their codeplex page. 另外,如果他们的github页面不起作用,请尝试使用他们的Codeplex页面。 I'm not quite sure which one of their code base is more up to date/work on (I'm fairly sure it's github though). 我不太确定他们的哪个代码库是最新的/正在研究中(我相当确定它是github)。

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

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