I am trying to put a barcode on a page and having problems. I can get the barcode to appear, however I cannot figure out how to position it correctly. I have tried three different ways - with the document.add example in the tutorial the barcode appears correctly but I can't figure out how to position it. When I use "placeBarcode" or PDFContentByte.addImage(barcodeImage) my whole document is blank. I did get one error message once that said something like invalid operation "q" but it's not consistent. Here is the code:
public void addBarCode(String text, double top, double left)
{
try
{
float x = inchesToPoints(left);
float y = inchesToPoints(top);BarcodePostnet barcode = new BarcodePostnet();
barcode.setCodeType(barcode.POSTNET);
barcode.setCode(text);
Image image = barcode.createImageWithBarcode(pdfContentByte, null, null);
image.setAbsolutePosition(100,100);
pdfContentByte.addImage(image);
//when i use this next line of code the whole document
//is blank - everything else i am putting on there
//disappears.....
//barcode.placeBarcode(pdfContentByte, null, null);
//this works but I can't get the barcode to show up
//in the right place on the page...
//document.add(new Phrase(new Chunk(image, 0, 0)));
}
catch(Exception de)
{
de.printStackTrace();
}
}Thanks, Teri
[EMAIL PROTECTED] wrote:
Send iText-questions mailing list submissions to [EMAIL PROTECTED]
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/itext-questions or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED]
You can reach the person managing the list at [EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific than "Re: Contents of iText-questions digest..."
Today's Topics:
1. Xml concern (Mark Goking) 2. ExceptionConverter: org.xml.sax.SAXParseException: Illegal character or entity reference syntax. (Mark Goking) 3. Re: Compare PDF documents (Leonard Rosenthol) 4. Is this a lack of iText's feature? Or is it my code (Mark Goking) 5. javadocs (Yuan Chang) 6. Re: javadocs (Bruno Lowagie) 7. Re: How to create bookmark that points to a table with custom outline name (Cosmin Popa) 8. Re: How to create bookmark that points to a table with custom outline name (Bruno Lowagie) 9. Re: Xml concern (Paulo Soares) 10. Re: Ideas to accomplish modified "keep together" and add background image? (Paulo Soares) 11. Re: How to create bookmark that points to a table with custom outline name (Bruno) 12. Re: Xml concern (Grzegorz Kucner)
--__--__--
Message: 1 Date: Thu, 17 Jul 2003 00:45:39 +0800 From: "Mark Goking" <[EMAIL PROTECTED]> To: "Bruno" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Subject: [iText-questions] Xml concern
My ResourceBundle class uses a UTF-8 saved property file to retrieve the values and write them to the xml file also saved as utf-8
This is my line code to create the xml file
write =3D new PrintWriter(new OutputStreamWriter(new FileOutputStream(xmlFile), "UTF-8"));
Now, when I checked the generated xml file, it seems that some characters have become garbled and not seen as the supposed unicode symbol representation
Do you think I should use another class to write a utf-8 saved xml file before converting it to pdf? Could you please give an example?
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003 =20
--__--__--
Message: 2 Date: Thu, 17 Jul 2003 00:06:08 +0800 From: "Mark Goking" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: [iText-questions] ExceptionConverter: org.xml.sax.SAXParseException: Illegal character or entity reference syntax.
ExceptionConverter: org.xml.sax.SAXParseException: Illegal character or entity reference syntax.
This error appears once my application converts the xml file to pdf. The xml is written as UTF-8. any idea what this exception means?
Mark
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003 =20
--__--__--
Message: 3 Date: Thu, 17 Jul 2003 00:33:27 -0400 To: "Andreas Probst" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] From: Leonard Rosenthol <[EMAIL PROTECTED]> Subject: Re: [iText-questions] Compare PDF documents
At 9:47 PM +0200 7/16/03, Andreas Probst wrote:
I'm developing an application which creates PDF files.
OK.
To automatically test this application, I'd need to compare PDF
documents, i.e. compare the current output of the app to once
created and verified reference files.
What would you compare? Visible output? Structure? Both?
Unfortunately two PDF files seem to be never binary equal, even if they look the same on the screen or on paper.
Correct. PDF files are quite complex entities and it is possible to have two files that are NOTHING alike in their file format, but produce the same visible results.
Is it possible to compare two files with iText?
No.
The only thing that attempts this is Adobe Acrobat...
Leonard
------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
