Forum


Replies: 8   Views: 1893
Include heading item number in cross reference
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 admin  · 03-04-2020 - 10:20

Hello,

Sorry, but we don't see that the HTML you are using is following our suggestion: maybe you could add the following change to be able to set custom modifiers.

Anyway, the HTML you are using:

<phpdocx_bookmark data-name="scoobie" data-type="start" /><phpdocx_heading data-text="Scoobie doo" data-level="2" data-pStyle="Heading2" data-b="" data-sz="" data-fontSize="" data-color="" data-font="" /><phpdocx_bookmark data-name="scoobie" data-type="end" />

is applying a Heading2 style name. Does it exist in your DOCX? if a style doesn't exist, the default normal style is applied. For example, if you are using the default template included in phpdocx, you could use:

<phpdocx_bookmark data-name="scoobie" data-type="start" /><phpdocx_heading data-text="Scoobie doo" data-level="2" data-pStyle="Heading2PHPDOCX" data-b="" data-sz="" data-fontSize="" data-color="" data-font="" /><phpdocx_bookmark data-name="scoobie" data-type="end" />

or create a custom paragraph style using phpdocx.

But you shouldn't confuse styles tags/attributes and heading tags when creating contents. A DOCX can have a normal style and a heading level; for example, the HTML you are transforming generates a paragraph with an outline level (data-level="2") and a normal style (because Heading2 style name doesn't exist in your DOCX).

Regards.