You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Positioning Endnotes is currently not working for 2 reasons:
PHPWord can only set properties for Footnotes, that Endnotes do not use in the final document
AFAICS, Endnotes positioning only works at the whole document level, not at the section level (even if OOXML spec and Word UI say otherwise - tested with multiple versions of Word), but PHPWord has no way to set Endnote properties (nor Footnote properties) at the document level.
Steps to Reproduce
Please provide a code sample that reproduces the issue.
<?phprequire__DIR__ . '/vendor/autoload.php';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$textrun = $section->addTextrun();
$textrun->addText('This is a piece of text with an endnote');
$endnote = $textrun->addEndnote();
$endnote->addText('This endnote should be at the end of the first section, which ends on the first page of this document');
$ep = newPhpOffice\PhpWord\ComplexType\FootnoteProperties();
$ep->setPos(PhpOffice\PhpWord\ComplexType\FootnoteProperties::POSITION_SECTION_END);
$section->setFootnoteProperties($ep);
$section = $phpWord->addSection();
$section->addText('There should not be any endnote below this text');
Expected Behavior
Have a way to set Endnote properties at the document level, something like $phpWord->setDefaultEndnoteProperties()
These default properties end up being written to the settings.xml file of the .docx output only if there is at least 1 endnote in the document, otherwise Word will complain that the file is corrupted
Endnotes in the document are positioned according to the default properties: using POSITION_SECTION_END results in Endnotes being positioned at the end of their section, not the end of the document.
Current Behavior
no w:endnotePr element is ever written to document.xml file with the Word writer
no w:endnotePr element (or w:footnotePr) is ever written to settings.xml file with the Word writer
Context
Please fill in your environment information:
PHP Version: 7.1
PHPWord Version: Git, HEAD of develop branch
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
Positioning Endnotes is currently not working for 2 reasons:
Steps to Reproduce
Please provide a code sample that reproduces the issue.
Expected Behavior
$phpWord->setDefaultEndnoteProperties()
Current Behavior
w:endnotePr
element is ever written to document.xml file with the Word writerw:endnotePr
element (orw:footnotePr
) is ever written to settings.xml file with the Word writerContext
Please fill in your environment information:
The text was updated successfully, but these errors were encountered: