Closed mfrasca closed 8 years ago
@HubelSB aquí se habla de hardware “our own CNC engraver”, me parece le pueda interesar! :fire: http://www.instructables.com/id/Arduino-Laser-Engraver/ ?
From @RoDuth on December 21, 2015 7:34
That's it!! Been toying with the idea of an Arduino project for a while now...
an other idea is that eps files are just text files, so if we would have just a couple of valid files for your CNC engravers, producing just any label of the correct size and with the right fonts, then we might convert these files into a mako template. not a big deal, this last part.
From @RoDuth on December 23, 2015 9:28
Will this work? His concern was that they needed to be vector files not text files. (i.e. you needed to outline the text with paths to get a path for the engraver to follow). After the silly season is over I'll go speak to the engraver and get a better idea of exactly what he wants and the formats that he can work with. (didn't know mako could generate .eps files)
»PostScript (PS) is a computer language for creating vector graphics« wikipedia, so I guess yes it will work. your engraver will probably tell you that the eps files you passed him had raster fonts (he already told you »he needs the fonts to be paths«.) it's quite some time since I last played with postscript programs, I kind of recall there was a fonts definition part, a page definition part, then the placing of (groups of) letters on the page. can you put here one of your labels (in eps format, zipped), that your engraver refused?
From @RoDuth on January 15, 2016 10:28
@mfrasca see the attached example of what the engraver is looking for. They said it was hard to get their system to export an example of what they would like as input but this would be a format that they could take. The finished size is 120x70mm which I think is demarked by the red lines. (in case you are wondering NATIVE CQCB is the "Label distribution" field of the species) Label.pdf
nope. I can use a .ps file (it's an ascii thing and it is a program), I cannot look inside of a pdf (binary) file. if it is not possible for them, then too bad, but you should insist in PostScript format. or I should go back to studying postscript myself and produce one with the characteristics of the pdf you posted here. and with a vectorial font, which is what your engraver says they need.
From @RoDuth on January 15, 2016 23:38
Dang blasted proprietary systems! From what I gather they would prefer the post script as the input anyway. I just think that pdf was all they could generate as an output from their software.
I'll attach the .eps file I generated from a .pdf using pdftops -eps
that they said was close to being usable, except for the fact that they only wanted 1 label at a time and the vector fonts. I generated the .pdf from an xsl template which I'll also add to the zip file. Don't laugh at my butchery of the original labels template!!
I just want to be able to generate a report that I can proof then send to the printers so they can print... Sounds so simple! So frustrating!
I'll speak to them again about the formats and see if they can give us something a little more usable.
From @RoDuth on January 15, 2016 23:43
Just a thought but what about putting their .pdf through pdftops -eps
? Surely that will work?
well, I think it's a bit complicated but doable. if I print from libreoffice a document that contains nothing more than all the letters you might want to ever use, using as font LiberationSerif, I get a ps where the glyphs are defined and numbered. ... then you have sequences of:
162 208 moveto
<0102030405060708090A0B0C0D0E0F101112131415161718191A>
[23 25 22 25 23 15 26 25 14 13 26 13 39 24 26 25 25 17 19 14 26 24 37 25 24 0]
xshow
where you first move to 162, 208, then show the gliphs 01-1A which have the widths as specified in the second parameter. it's almost RPN, like old HP calculators.
can you ask your engraver if they would be able to print this one? test.zip (if you do not like the font... we choose it later, let's first see if this is acceptable to the engraver.) (the postscript code here looks quite different than the eps you posted before)
pfffffffff you also want bold and italic! :scream: I don't know... it is possible to produce it programmatically directly from Mako, but it's quite a bit of preparation almost by hand. maybe there are tools to do this easier. however, once programmed, it would be very lightweight, no more dependencies than Mako itself. but one font.
having the sample, with your desired vector font, page size correctly set, and some text already in place, the task would be trivial. ... and no, transforming a pdf into postscript would not transform the raster pdf into a vector ps.
From @RoDuth on January 16, 2016 4:11
Of course!! Don't want to make things too easy :smile:
Will speak to them early next week. Just tried to open your file with everything I have here that will take .ps and all I get is a blank page with this at the top?: Am I doing something wrong?
did you expect me to produce already a real label ? :open_mouth: before tomorrow, it might be, but at the moment I do not even know how to tell libreoffice to produce a custom sized page. and you should also ask your engraver if the 120×70 is the black frame or the red one, or if they need some extra millimetres margin outside the 120×70.
still not sure about page size, nor of the printed effect, nor whether the position of the parts are to your liking, but this does sort of print labels for the species in your selection. rough.zip
Mako is really powerful. very nice choice @brettatoms .
From @RoDuth on January 17, 2016 4:56
Wow looks great! Just had a go with the template. A few minor issues (e.g. doesn't do the infraspecific parts) but before anything, let me contact the engravers next week and make sure that it IS the sort of file they are looking for first.
Out of curiosity, in your opinion, Mako is better than the xsl formatter? I have not used the Mako formatter. Guess I should learn :fearful:
I'm on the opposite position: I never used the XSL formatter. I guess it's the correct tool for producing xml, while Mako looks to me fine for things like csv, (sloppy) html, and PostScript. without Mako already in place, I would have chosen Jinja2, just because I had used it elsewhere and it is probably more main-stream.
From @brettatoms on January 17, 2016 13:52
@mfrasca That's a good idea to use mako to generate the postscript. When I chose Mako ~10 years ago Jinja2 hadn't yet become the "winner" of the python templating languages. Today I use Jinja2 everywhere. Mostly because its bundled with Flask.
@RoDuth The reason for XSL is because it has a component called XSL-FO which is kind of like CSS but for paged and printed media. It's great for generating pixel perfect PDFs but it's extremely complicated and has a high learning curve. I probably would have reached for XSL first for this task as well but @mfrasca made a good call doing it this way with mako. Any day I can avoid using XSL is a good day. ;)
use #140
From @RoDuth on December 20, 2015 6:20
Have been using printed labels for some time now and are looking to go to engraved plastic labels very soon. I have been speaking to the local engravers and would prefer to be able to use the reporting system to generate a file the engraver can use directly with his CNC engraver. I can proof it before sending it off to make sure everything looks right. No risk of human error. I can design the label styles I want and make the choice myself as to which accession gets which style etc. etc. Have been playing with the XSL formatter and the sample templates but have run into a couple of issues.
.eps
file so I usedpdftops
with the-eps
switch to convert from the.pdf
output of the xsl formatter. Now he says he needs the fonts to be paths (vectors). I'm sure there is some way to getGIMP
to do the paths part but cant work it out (haven't used GIMP in years) and keep thinking there must be an easier way with less manual steps.Would be nice to power our own CNC engraver straight from the database one day. (open source hardware maybe?)
Any ideas?
Copied from original issue: Bauble/bauble.classic#227