Skip to content

Include page border in docx file feature#118

Open
josongvmtechphp wants to merge 1 commit into
evidenceprime:masterfrom
josongvmtechphp:patch/put-page-border-in-docx
Open

Include page border in docx file feature#118
josongvmtechphp wants to merge 1 commit into
evidenceprime:masterfrom
josongvmtechphp:patch/put-page-border-in-docx

Conversation

@josongvmtechphp

@josongvmtechphp josongvmtechphp commented Jul 14, 2020

Copy link
Copy Markdown

This is a new feature of this tool. I tried to generate a docx file with page border using this tool. But I could not achieve this goal. Based on this experience, I understood that this tool did not provide a feature to put a page border on docx file pages. I found a solution for this problem. This pull request contains the solution for this mentioned problem.

var converted = htmlDocx.asBlob(content);
saveAs(converted, 'test.docx');

pageBorder additional option included in asBlob for controlling page border setup for the document:

  • pageBorder
    • isShow: Whether the page border is included or not (true or false)
    • offsetFrom: Specifies how the relative positioning of the borders should be calculated ('page' or 'text')
    • display: Specifies on which pages to display the border ('allPages', 'firstPage', 'notFirstPage')
    • zOrder: Specifies whether the page border is positioned above or below intersecting text and objects ('back', 'front')
    • topBorderStyle: Specifies the style of the top border('single', 'dashed ',..)
    • topBorderWidth: Specifies the width of the top border
    • topBorderSpacingOffset: Specifies the spacing offset of top border.
    • topBorderColor: Specifies the color of the border of the top border.
    • bottomBorderStyle: Specifies the style of the bottom border('single', 'dashed ',..)
    • bottomBorderWidth: Specifies the width of the bottom border
    • bottomBorderSpacingOffset: Specifies the spacing offset of bottom border.
    • bottomBorderColor: Specifies the color of the border of the bottom border.
    • leftBorderStyle: Specifies the style of the left border('single', 'dashed ',..)
    • leftBorderWidth: Specifies the width of the left border
    • leftBorderSpacingOffset: Specifies the spacing offset of left border.
    • leftBorderColor: Specifies the color of the border of the left border.
    • rightBorderStyle: Specifies the style of the left border('single', 'dashed ',..)
    • rightBorderWidth: Specifies the width of the right border
    • rightBorderSpacingOffset: Specifies the spacing offset of right border.
    • rightBorderColor: Specifies the color of the border of the right border.

If you want to know more,please visit the below link

http://officeopenxml.com/WPsectionBorders.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant