Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 10 23:57

    dolanmiu on gh-pages

    Deploy dolanmiu/docx to github.… (compare)

  • May 10 23:52

    dolanmiu on npm_and_yarn

    (compare)

  • May 10 23:52

    dolanmiu on master

    Bump mocha from 8.3.2 to 8.4.0 … Merge pull request #935 from do… (compare)

  • May 10 23:52
    dolanmiu closed #935
  • May 10 23:52

    dolanmiu on master

    Bump @types/chai from 4.2.17 to… Merge pull request #936 from do… (compare)

  • May 10 23:52

    dolanmiu on npm_and_yarn

    (compare)

  • May 10 23:52
    dolanmiu closed #936
  • May 10 19:03
    jdgabriel starred dolanmiu/docx
  • May 10 18:10
    bolejnik starred dolanmiu/docx
  • May 10 10:02
    hueyhe starred dolanmiu/docx
  • May 10 05:15
    codecov-commenter commented #936
  • May 10 05:13
    codecov-commenter commented #936
  • May 10 05:12
    codecov-commenter commented #936
  • May 10 05:11
    codecov-commenter commented #935
  • May 10 05:09
    dependabot[bot] labeled #937
  • May 10 05:09
    dependabot[bot] opened #937
  • May 10 05:09

    dependabot[bot] on npm_and_yarn

    Bump prettier from 2.2.1 to 2.3… (compare)

  • May 10 05:08
    dependabot[bot] labeled #936
  • May 10 05:08
    dependabot[bot] opened #936
  • May 10 05:08

    dependabot[bot] on npm_and_yarn

    Bump @types/chai from 4.2.17 to… (compare)

Rishabh Madan
@rishtech20
Quick fix that I found was this:
docx.Media.addImage(doc);
for (let i = 0; i < data.coverages.length; i++) {
// //doc
// .createParagraph(data.coverages[i].headline)
// .style("indexHeadingStyle")
// .spacing({
// before: 200,
// after: 800
// });
const image2 = docx.Media.addImage(
doc,
fs.readFileSync("awesome-pictures-32-1.jpg")
);
doc.addImage(image2);
//doc.createParagraph("").pageBreak();
}
Seems like a bug
Dolan
@dolanmiu
table widths are currently being re-done as of v5
at the moment table widths are weirdly implemented
i will look into this bug
David
@ditiem
Please, @dolanmiu, have a quick look to the header issue i mentioned on Feb 07. I think it is a nonsense and it should be easy to fix. If you dont have time I will look into it once I release the project I am currently working on.
Dolan
@dolanmiu
ok ill have a look into this too
Dolan
@dolanmiu
ok @ditiem seems like its a bug
will work on it for the v5 release asap
leave this one to me, i want to re-design the api of it a little. I am not liking the doc.createFirstPageHeader(); doc.createEvenPageHeader(); doc.createHeader(); methods
seems confusing
Rishabh Madan
@rishtech20
Is there any way to add border to the images?
Dolan
@dolanmiu
not yet im afraid
Ky
@ky-cheng
Is there a way to insert url hyperlink to the document?
Ky
@ky-cheng
Nevermind, I work out you can use document.createHyperlink(), sorry I didn't see an example in documentation site so couldn't find it earlier. Thanks.
Dolan
@dolanmiu
Yup that is right
Sorry for the late reply
Ky
@ky-cheng
All good! Thank you for this great package! Happy weekend :)
DennisAtDept
@DennisAtDept
image.png

Hi all,

Is there any way to add a table style to a table like you can with paragraphs?

.e.g:
new Paragraph().style("My Paragraph style"); works

but
new Table().style("My table style"); is not supported

I know you can add styling per cell which works fine, but sometimes i want to add additional lines to a table in word after the document is generated.
Word is not smart enough alterate between the styling of even and uneven rows.

To be able to just use the ootb styles available in word is more then enough for my purposes

image.png
Dolan
@dolanmiu
This might be a feature request, I haven’t explored styles in tables yet, but adding borders is possible
DennisAtDept
@DennisAtDept

Hi Dolan,

Thank you for the quick reply, setting the borders and background colours of the cells is indeed possible, but when the person generating these documents wants to adds additional rows to the table, the background colours of the additional rows matches the row that is generated as last instead of alternating between two colours.

I will see if i can add a feature request :)

Using a existing table style or some option to define alternating table row colours is good enough.

DennisAtDept
@DennisAtDept
I'm sorry, what is the propper way to add a feature request?
Dolan
@dolanmiu
Proper way to request a feature is to create an issue on GitHub! :)
Carl Block
@carlblock
Is there someway to insert paragraphs into an already created section?
Something like this? doc.document.body.sections[0].children.push(new Paragraph("Hello"));
Carl Block
@carlblock
@dolanmiu Sorry for doing a mention, I just realised this gitter seems very inactive since July. Is there another more active place for questions?
Dolan
@dolanmiu
GitHub issues
Should probs use this chat more though
Carl Block
@carlblock
Okay, I was thinking that but I'm just afraid of "littering" of non-issues
Dolan
@dolanmiu
And no, there’s no way (and shouldn’t be) a way to add paragraphs to an existing section
Carl Block
@carlblock
Okay
Dolan
@dolanmiu
Gitter is buggy on iOS, I can’t access Gitter on my computer at work, blocked
Carl Block
@carlblock
Because I'm doing a recursive function to create a tree of some HTML content to recreate it with docxjs
Dolan
@dolanmiu
You can create the section object, then at the final recursion step do a doc.addSection
Carl Block
@carlblock
Basically converting quite simple HTML DOM to a docxjs document. I've already managed to create a JSON representation of the DOM. But I thought I could apply the same method to construct a docxjs
That's true, didn't think about that :)
Dolan
@dolanmiu
Why not separate your concerns so you have a two step process? It will be healthier for the codebase Have the recursion step to create the data you need, then have a “docx” step to create the word document
Carl Block
@carlblock
That does indeed seem better
Dolan
@dolanmiu
Mixing in concerns in general makes headaches for other devs (and your future self) reading the code :wink:
Cool, hope I helped, I’ll use this chat more often in future
Carl Block
@carlblock
Yeah you did! Thanks a lot, if I succeed to make a neat HTML -> docxjs module I could post it in the issues for others to take some inspo later on
Dolan
@dolanmiu
do you mind if I add your company name on the README? @carlblock
Carl Block
@carlblock
@dolanmiu Sure no problem! :)
Dolan
@dolanmiu
What is the company?
Carl Block
@carlblock
herraizsoto&co.
theProf
@theProf
i may not be in the right place, since it doesn't seem there's been any activity here for year
but i had some questions about the docx specification, and a direction for adding custom metadata that isn't stripped on save by word or libreoffice. figured there might be some knowldgable people here, but maybe this chat is just inactive. i'll check back. but otherwise, fan of docxjs. been a useful tool
Uladzimir Miadzinski
@uladzimir-miadzinski
Hi there! Where can I find browser support list for 'docx' library?