Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page borders demo not work #2675

Open
websashka opened this issue Apr 22, 2024 · 0 comments
Open

Page borders demo not work #2675

websashka opened this issue Apr 22, 2024 · 0 comments

Comments

@websashka
Copy link

Related to #1256
https://github.com/dolanmiu/docx/blob/master/demo/71-page-borders-2.ts
@dolanmiu, could you check this problem? I check it in use page app, google document.
docx version 8.5.0

const doc = new Document({
  sections: [{
    properties: {
      page:{
        borders:{
          pageBorderBottom: {
            style: BorderStyle.SINGLE,
            size: 2*8, //2pt;
            color: '000000',
          },
          pageBorderLeft: {
            style: BorderStyle.SINGLE,
            size: 1*8, //1pt;
            color: '000000',
          },
          pageBorderRight: {
            style: BorderStyle.SINGLE,
            size: 1*8, //1pt;
            color: 'FF00AA',
          },
          pageBorderTop: {
            style: BorderStyle.SINGLE,
            size: 1*8, //1pt;
            color: '000000',
          },

          pageBorders: {
            display: "allPages", //https://docx.js.org/api/enums/PageBorderDisplay.html
            offsetFrom: "text", //https://docx.js.org/api/enums/PageBorderOffsetFrom.html
            zOrder: "front" //https://docx.js.org/api/enums/PageBorderZOrder.html
          }
        }
      },
    },
    children: [
      new Paragraph({
        children: [
          new TextRun({ text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`})
        ]
      }),
      new Paragraph({
        children: [
          new TextRun({ text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`})
        ]
      })
    ]
  }],
});
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

No branches or pull requests

1 participant