How do I import a .docx file into Lightburn?

OK, at the moment it’s a very simple proof of concept, but it works. I’m just about to add some font handling stuff to it, but beyond that what would you need? Does your document contain multiple fonts/sizes? (That’s easy enough to handle.) What about images? Tables? Any fancy formatting? These will all be described in the document structure, but I don’t want to use the original if we need to get in to any NDA stuff. I can dummy up a document with the features you need unless you can provide something similar to the original.

A big caveat of course is that the more complex the document the harder the task, and while I am a competent programmer I don’t know all the ins and outs of either docx or lbrn2 files. I’m sure there’s a better way of doing this, but I am up for the challenge though. Maybe you can find someone who can open the document in a newer version of Word and print to PDF in a vector format? Or maybe an upgrade to your PDF driver? I’m not an Apple guy so I don’t know if there are any alternatives to Word that you could install to get you what you need.

One more thing before we get started, if we’re going to do this - have you done a test with your laser and proposed material on some similar text within LightBurn to make sure you get results you’re happy with? It would be a shame to do all this and then not be able to actually produce the finished article to your satisfaction!

FWIW, I just opened up a docx file in LibreOffice which had test and images and exported it as PDF where it vectorized the text and copied the images. When I opened the PDF and zoomed way in the text was crisp and clear while the images started getting pixelated. I’ve seen a number of Microsoft exported PDF files which were just pages of images of the original document pages.

Asking Microsoft to support some other company’s file format is fruitless so better to use another product.

I did a quick test with LibreOffice Writer on Ubuntu and was unable to get LightBurn to open the PDF file. I tried with other PDFs and some were successful in opening, but not complete (probably not vector based), and others wouldn’t open at all. Not sure where the problem lies in all of this, but your test is exactly what I would have expected - crisp vectored text but pixelated images. You can however set the image compression to Lossless and the image resolution to a given DPI. Not that I have any images in my documents to test with.

What I did was open the docx file in LibreOffice and export as PDF, then I opened this PDF in Inkscape, selecting the page I wanted, ungrouped, selected the text blocks and converted Object to Path then saved the page as an SVG which LightBurn imported.

This can probably be scripted.

1 Like

I’ve already used the set-up to successfully mark the durable media. It took a little fussing to get it just right, but that’s normal.

Mostly the documents are just text, with some minor formatting, a header might have a larger font size. There might be some italics, bolds, or underlines. No fancy graphics, if any of those are needed, they can be created in a CAD program and more gracefully imported from there. One document does have some tables, and although supporting columns would be handy, I can hand create those as text with some attention to spacing and line/paragraph breaks. I can always change the font to one supported, it isn’t as important as what the words say!

How would I get a sample document to you?

(I would have replied sooner, but “You’ve reached the maximum number of replies a new user can create on their first day.” Who knew?)

That works! The key points I was missing are washing it through LibreOffice and ungrouping. Thanks!

DOS ain’t done till Lotus won’t run.

Still hopeful that DaveAK has a simpler seamless solution…

1 Like

I have bumped your account and removed this limit. :slight_smile:

@nully A file probably won’t be necessary for a while. I’m mocking something up that will cover the basics and I can use to develop the app. We can get more in to the weeds in a couple of days when I have something to show. I trust you’re not on a super tight deadline? Luckily my whole day has opened up so I can get a good crack at this.

Thanks. Not a problem to have something of a troll filter…

Nope, no hurry, fast is good. One of the things I like about having left Silicon Valley is people here (including me!) don’t want everything right now OR SOONER!

@nully Just to keep you up to date on progress. I have a good outline of what needs to be done. I expect to get it producing some kind of formatted text by the end of today, clean that up tomorrow and add images and tables over the weekend. Of course this all depends on time available to me, but I have nothing else pressing right now and I’m finding it a fun project. :smiley:

Thanks! Perhaps LightBurn would be interested in licensing or buying it?

Microsoft Word does not play nice with other programs.
It is extremely sensitive to print drivers. Change printers and your document and fonts will change.
Install a print driver for a postscript based laser printer. Have this “new” printer as the active target printer when you open your file. Now have Word export the file as a PDF. It will use something called PDFMaker to generate the PDF. Text will be perfect and any graphics will be at whatever resolution they were when placed in word.

When I’ve transitioned PDFs to vector-based programs (for 3DP, CNC milling, vinyl cutting, laser engraving), I pull the PDF into Adobe Illustrator, convert text to outlines, & export as SVG. Illustrator can handle macro-batch operations.

Thanks to both you and chuck12563. It’s good to have multiple paths to success!

@nully So progress hasn’t been as well as I had hoped. Somewhere along the way I took a big step backwards, then sideways, but now I’m where I had hoped to be on Friday. Which means no images or tables yet. (Tables will take precedent over images considering your needs.)

I’ve attached a couple of screenshots below taken with the original document in LibreOffice Writer shown against the LightBurn file, as best as I could scale the views to be similar. As you can see the results are close but not exact. Firstly the applications render the same font differently, and there’s nothing I can do about that. The position of the title is way off, and the line spacing is slightly off. These are controlled by my application and I’m working on fixes. Fitting a line of text within the margins correctly is also causing problems. I suspect the culprit is that the Java rendering engine I’m using to determine sizes also renders the fonts differently to the other two applications.

What about headers and footers? I haven’t looked at them yet but I’m not expecting any particular issues. I need to do the fixes I’ve mentioned plus a couple of other minor tasks. Then add in underlining and headers/footers if you need those. That should get us to a point where you can run a file through it.

Looking good!

if you use acrobat , the zoom should give cleartype fonts - then screen cap and paste into lightburn.

then use trace image and fill , looks pretty good to me.

Danke! Aber ich habe keinen Acrobat. Eines Tages werde ich…

@nully I just sent you a message. Let me know if you get it or if we need to get some help from the LightBurn folks so that we can open up a line of communication outside of this thread.