Forum


Replies: 4   Views: 3074
Remove header information from adobe reader's top status bar
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by davelavinsky  · 01-11-2016 - 10:07

I have in the header of a template docx file - $COMPANY_NAME$ BUSINESS PLAN

which gets replaced by the name of the Company ($COMPANY_NAME$).

But when I convert this to PDF via $docx->transformDocument("temp/$ID.docx", "temp/$ID.pdf");

And I open this in Adobe reader, I get on the top of the file (not in the content - but top status bar) : file-name.pdf - $COMPANY_NAME$ BUSINESS PLAN

I don't know how this is showing. But I need a way to remove this.

http://imgur.com/aavqBbR

Posted by admin  · 01-11-2016 - 11:26

Hello,

Please send the PDF to contact[at]phpdocx.com and we'll check it.

Did you try opening the same PDF with other PDF viewers? Or with Adobe Reader for Windows?

Regards.

Posted by admin  · 01-11-2016 - 19:14

Hello,

The problem with your PDF is that the title property (you can see it in the Properties section using Adobe Acrobat Reader) is $COMPANY_NAME$ BUSINESS PLAN , so Acrobat Reader shows this property in the header.

DOCX documents have properties too (the title property is used as PDF title property when transforming it). It seems your DOCX title property is $COMPANY_NAME$ BUSINESS PLAN; you can set this property (DOCX properties https://support.office.com/en-us/article/View-or-change-the-properties-for-an-Office-file-21d604c2-481e-4379-8e54-1dd4622c6b75#viewchange16) in the template or change it using this method:

http://www.phpdocx.com/api-documentation/layout-and-general/modify-Word-document-properties-with-PHP

Regards.

Posted by davelavinsky  · 02-11-2016 - 10:21

Thanks, the addProperties solved my problem.

$properties = [
    'title' => $bp->Name
];
$docx->addProperties($properties);