poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Beeker <kiwiwi...@apache.org>
Subject Re: Writing content in ttf code128
Date Fri, 08 Mar 2019 16:44:23 GMT

just to recap:
a) you want to email a .docx file to your clients
b) this .docx file contains a .xlsx file as an embedded document
c) this .xlsx contains cells with barcodes formatted via a code128 font

Regarding c):
My guess is you need to set the barcode string as text value of a cell and set the style for
the barcode font.
check http://poi.apache.org/components/spreadsheet/quick-guide.html for the basics.

Regarding b)
I haven't found a tutorial on how to embed other office documents on a quick view, but this
is definitely possible. Usually I re-engineer a sample document by unzipping it and checking
the contents of the various files.
It helps if you compare the contents before and after you've added the .xlsx.
POI gives you access to the various files either via low-level OPC API (see org.apache.poi.openxml4j.opc.OPCPackage)
or via some high-level document based API (see http://poi.apache.org/components/document/quick-guide-xwpf.html)

Regarding a)
Out-of-focus for here - but Apache Commons Email is your friend

So regarding your questions:
1) yes
2) how would a .csv contain information about a font? (rhetorical question)
... so you need either .xls or .xlsx or some other style-able format
3) if you intend to call XSSFSheet.autoSizeColumn then yes, otherwise no

a bit off-topic: if embedding the .xlsx is too much hassle, I would simply add an additional
email attachment containing the .xlsx ...


On 06.03.19 18:14, Luiz Antonio Falaguasta Barbosa - CNPTIA wrote:
> I need to create a spreadsheet and write one of its columns in ttf code128. This spreadsheet
(with data from DBMS) will be used in a direct mail, into Word, to generate tags based on
data from the spreadsheet. 
> 1. Can I use POI to do that? 
> 2. Do I need to create the spreadsheet as a .xls file or can I create a .csv file? 
> 3. Do I need to install ttf code128 in the webserver where I will have Java code that
create the spreadsheet with data from DBMS? 

View raw message