Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:34
    Kastrcn starred dolanmiu/docx
  • 04:07

    dolanmiu on cspell

    Fix more spelling rules (compare)

  • 02:05
    dclcats starred dolanmiu/docx
  • 01:28
    pablohirafuji commented #1201
  • Jul 04 23:29
    pablohirafuji commented #1201
  • Jul 04 13:51

    dolanmiu on cspell

    Introduce CSpell (compare)

  • Jul 04 11:01
    dependabot[bot] labeled #1572
  • Jul 04 11:01
    dependabot[bot] opened #1572
  • Jul 04 11:01

    dependabot[bot] on npm_and_yarn

    build(deps-dev): bump ts-node f… (compare)

  • Jul 04 11:01
    dependabot[bot] labeled #1571
  • Jul 04 11:01
    dependabot[bot] opened #1571
  • Jul 04 11:01

    dependabot[bot] on npm_and_yarn

    build(deps): bump @types/node f… (compare)

  • Jul 04 11:01
    dependabot[bot] labeled #1570
  • Jul 04 11:01
    dependabot[bot] opened #1570
  • Jul 04 11:01

    dependabot[bot] on npm_and_yarn

    build(deps-dev): bump typedoc f… (compare)

  • Jul 04 09:02
  • Jul 04 02:09

    dolanmiu on 7.4.0

    (compare)

  • Jul 04 02:05

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ do… (compare)

  • Jul 04 02:03

    dolanmiu on master

    Version bump (compare)

  • Jul 04 00:58
    istisiki starred dolanmiu/docx
Dolan
@dolanmiu
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?
Metheny80
@Metheny80
is there any way to measure the room left in a page in pixels/inches ?
Dolan
@dolanmiu
No way to measure the amount of room left as everything is declared as is, there’s no way to read word documents to gather information
And it should support all major browsers, maybe IE won’t work though
Metheny80
@Metheny80
i mean when i create a document, and before exporting it to a file.
since all the information should be available (font size, spacing etc.)