poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luiz Antonio Falaguasta Barbosa - CNPTIA <luiz.barb...@embrapa.br>
Subject Re: Writing content in ttf code128
Date Fri, 08 Mar 2019 17:24:43 GMT

Thanks Andreas. 

I got to do what I need yesterday, looking here: 




Atenciosamente, Luiz Antonio Falaguasta Barbosa 
Embrapa Informática Agropecuária (CNPTIA) 
Embrapa Brasil eira de P e squisa Agropecu ária ( Embrapa) 
Campinas - SP 

Fone: +55 (19) 3211-5843 
https://www.embrapa.br/informatica-agropecuaria www.embrapa.br | fb.com/embrapa | twitter.com/embrapa

----- Original Message -----

From: "Andreas Beeker" <kiwiwings@apache.org> 
To: user@poi.apache.org 
Sent: Friday, March 8, 2019 1:44:23 PM 
Subject: Re: Writing content in ttf code128 


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? 

Aviso de confidencialidade

Esta mensagem da Empresa  Brasileira de Pesquisa  Agropecuaria (Embrapa), empresa publica
federal  regida pelo disposto  na Lei Federal no. 5.851,  de 7 de dezembro de 1972,  e  enviada
exclusivamente  a seu destinatario e pode conter informacoes  confidenciais, protegidas  por
sigilo profissional.  Sua utilizacao desautorizada  e ilegal e  sujeita o infrator as penas
da lei. Se voce  a recebeu indevidamente, queira, por gentileza, reenvia-la ao emitente, esclarecendo
o equivoco.

Confidentiality note

This message from Empresa  Brasileira de Pesquisa  Agropecuaria (Embrapa), a government company
 established under  Brazilian law (5.851/72), is directed exclusively to  its addressee  and
may contain confidential data,  protected under  professional secrecy  rules. Its unauthorized
 use is illegal and  may subject the transgressor to the law's penalties. If you are not the
addressee, please send it back, elucidating the failure.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message