Re: [iText-questions] Tables and borders

2011-06-30 Thread hhn000
Yeah, that's what I ended up doing, I just feel it should be "cleaner" or
"smarter" (I really like the idea of setting borders, etc all in one place,
table.DefaultCell - now I have it in my own method, also doable), this is
not meant in a bad way, this is a two platform library, which in it self
have some limitations, there are some things that could be made different in
the C# implementation, but it's important that the code look basically the
same on both platforms.

Well, I encountered a server breaking bug in another PDF library, which is
why I switched, compared to that iTextSharp just needs some learning how
things work, so good stuff :-)

On Thu, Jun 30, 2011 at 16:50, Emiel Ackermann
wrote:

> **
> In Java, I would instantiate the cell and disable the border of the cell
> with:
>
> cell.setBorder(Rectangle.NO_BORDER);
>
> before returning it within your method
>
>
> private PdfPCell NewCell(string text, FaxFonts font, int colspan)
> {
> return new PdfPCell(new Phrase(text, _fonts[(int)font].Font)) {
> Colspan = colspan };
> }
> Op 30/06/2011 13:18, hhn000 schreef:
>
> It seems that the problem is that I'm using new PDFPCell to create the new
> cell instead of using AddCell(Phrase), so it doesn't know about the table.
>
> But if I create the new cell from table.DefaultCell, doesn't it create a
> copy of the table? which gets thrown away when adding the cell with
> AddCell(PDFPCell).
>
> The easiest solution would be if AddCell(Phrase) returned the newly added
> cell, so I could adjust the colspan... but then AddCell looks to need to
> know about it when adding the cell...
>
> Some kind of factory method that returns a PDFPCell suitable for addition
> with AddCell() without any unnecessary overhead would be nice.
>
> Did I miss something? Or do something in a wrong way?
>
> On Thu, Jun 30, 2011 at 09:42, hhn000  wrote:
>
>> Does anyone have any ideas about the problem? I have checked the source,
>> but I can't see any difference between AddCell(string) and AddCell(new
>> PDFPCell(new Phrase(string, font). If so, the only change is the Colspan, I
>> haven't checked the generation from the table, but there doesn't seem to be
>> any obvious reason why that would affect the borders (at least to me without
>> reading the code).
>>
>> Any help would be much appreciated.
>>
>>
>> On Wed, Jun 29, 2011 at 11:14, hhn000  wrote:
>>
>>> Ok, I'm adding the rows using the following code:
>>>
>>> public void DrawBlock(ITextColumns block)
>>>
>>> {
>>> var table = new PdfPTable(block.Widths);
>>> table.WidthPercentage = 100f;
>>> table.DefaultCell.Border = Rectangle.NO_BORDER;
>>>
>>>  AddRows(table, block.Spans1, block.Rows1, block.Fonts);
>>> AddRows(table, block.Spans2, block.Rows2, block.Fonts);
>>>
>>> _document.Add(table);
>>> }
>>>
>>> private void AddRows(PdfPTable table, int[] spans, List
>>> rows, FaxFonts[] fonts)
>>> {
>>> foreach (var row in rows)
>>> {
>>> var j = 0;
>>> for (var i = 0; i < spans.Length; i++)
>>> if (spans[i] > 0)
>>> {
>>> table.AddCell(NewCell(row[j], fonts[i],
>>> spans[i]));
>>> j++;
>>> }
>>> }
>>> }
>>>
>>> private PdfPCell NewCell(string text, FaxFonts font, int colspan)
>>> {
>>> return new PdfPCell(new Phrase(text, _fonts[(int)font].Font))
>>> { Colspan = colspan };
>>> }
>>>
>>> In AddRows spans look like { 1, 1, 1, 1, 1, 1 } or { 4, 0, 0, 0, 1, 1 }
>>> Each row like { "col1", "col2", "col3", "col4", "col5", "col6" } or {
>>> "col1", "col2", "col3", "col4" } for the above spans.
>>>
>>> IIRC i was using table.AddCell(row[i]) when it didn't show the borders
>>> earlier.
>>>
>>>
>>> On Wed, Jun 29, 2011 at 10:47, 1T3XT BVBA  wrote:
>>>
 On 29/06/2011 9:24, hhn000 wrote:
 >
 > Does anyone have any idea of what I'm doing wrong?
  We don't have sufficient information to answer that question.
 1. You say that you initially turned borders off and it worked.
 2. Then you turned them on and it worked.
 3. Now you turned them back off and it no longer works.
 We don't know what else you changed in 2.
 Maybe you've started working with PdfPCell objects instead of just the
 addCell() method.
 Only you know, so we don't have the answer: you have.


 --
 All of the data generated in your IT infrastructure is seriously
 valuable.
 Why? It contains a definitive record of application performance,
 security
 threats, fraudulent activity, and more. Splunk takes this data and makes
 sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-d2d-c2
 ___

Re: [iText-questions] how to get GraphicState from PdfContentByte

2011-06-30 Thread 1T3XT BVBA
On 30/06/2011 19:54, Crag Markwood wrote:
> Hello,
> I'm adding a template and need to set the font. I would like to get the 
> existing font from PdfContentByte (pcb below) but the pcb.state is protected. 
> How can I access it?

You can't and you shouldn't.
Let's take a look at your example:
>  PdfTemplate template = pcb.createTemplate(w, h);
>  template.beginText();
>  template.setFontAndSize(font, 9);
>  template.showText(text);
>  template.endText();

In this template, you create PDF syntax and you use the Tf operator to 
set the font and size.
This Tf operator is a "text state" operator. It's illegal and useless 
outside a BT/ET text block.
Not that creating a BT/ET block and showing text WITHOUT the Tf operator 
is illegal too.
That's why you correctly put setFontAndSize() inside a beginText() and 
endText() sequence.

All other Tf operators outside the BT/ET sequence are irrelevant.
If you've set a different font and size outside this "template", they 
won't affect the content of the template.
Therefore asking the pcb object for its font and size doesn't make sense.
If a Tf operator was present at some point, it was present inside a 
CLOSED BT/ET sequence, before:

>pcb.addTemplate(template, xScale, xRote, yRote, yScale, x, y);

I'm 99% sure that's not the answer you wanted.
You should read this answer as the technical explanation why I don't 
understand your question.
Please clarify: why do you need a font you've used in a PdfContentByte 
object before.
What makes you think this is a font? (There doesn't have to be one!)
What makes you think there is only one font? (There could be many!)

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


[iText-questions] how to get GraphicState from PdfContentByte

2011-06-30 Thread Crag Markwood
Hello,
I'm adding a template and need to set the font. I would like to get the 
existing font from PdfContentByte (pcb below) but the pcb.state is protected. 
How can I access it?
Thanks!

PdfTemplate template = pcb.createTemplate(w, h);
template.beginText();
template.setFontAndSize(font, 9);
template.showText(text);
template.endText();

  pcb.addTemplate(template, xScale, xRote, yRote, yScale, x, y);


ZALICUS INC.
245 First Street, Third Floor
Cambridge, MA 02142
www.zalicus.com


This email and any attachments may contain CONFIDENTIAL or PRIVILEGED 
information and is a private communication between the intended addressee and 
Zalicus Inc. or its subsidiaries.  If you have received this email in error, 
reading, copying, using or disclosing its contents to others is prohibited.  
Please notify us of the delivery error by replying to this message and then 
delete it from your system.  Thank you.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Sign a PDF/A

2011-06-30 Thread Leonard Rosenthol
No, you are correct that according to the corrigenda that is the case.
However, most implementations still do a more strict checking...

Leonard

On 6/29/11 11:22 PM, "mkl"  wrote:

>Leonard,
>
>Leonard Rosenthol-3 wrote:
>> 
>> Or PDF/A, the namespaces are fixed.
>> 
>
>Just to be sure... are they really? Especially, is 'xmp'?
>
>According to ISO 19005-1:2005/Cor.1:2007(E) a NOTE 3 is added after note 2
>of Subclause 6.7.2 of ISO 19005-1:2005:
>
>³NOTE 3 According to the W3C XML Namespace recommendation [18], namespace
>prefixes are shortcuts to namespace URIs. No significance is given to the
>prefix itself. Conventional prefixes are used in this subclause for
>example
>purposes. Except where a specific prefix is identified as required (in
>6.7.8
>and 6.7.11), any prefix can be used.²
>
>The only prefixes identified as required in 6.7.8 and 6.7.11 are
>pdfaExtension, pdfaSchema, pdfaProperty, pdfaType, pdfaField in 6.7.8 and
>pdfaid in 6.7.11.
>
>Even though 'xmp' is preferred, 'xap' , therefore, still is allowed.
>
>Or do I miss something important here?
>
>Regards,   Michael.
>
>--
>View this message in context:
>http://itext-general.2136553.n4.nabble.com/Sign-a-PDF-A-tp3627882p3634063.
>html
>Sent from the iText - General mailing list archive at Nabble.com.
>
>--
>
>All of the data generated in your IT infrastructure is seriously valuable.
>Why? It contains a definitive record of application performance, security
>threats, fraudulent activity, and more. Splunk takes this data and makes
>sense of it. IT sense. And common sense.
>http://p.sf.net/sfu/splunk-d2d-c2
>___
>iText-questions mailing list
>iText-questions@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>iText(R) is a registered trademark of 1T3XT BVBA.
>Many questions posted to this list can (and will) be answered with a
>reference to the iText book: http://www.itextpdf.com/book/
>Please check the keywords list before you ask for examples:
>http://itextpdf.com/themes/keywords.php


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


[iText-questions] **** Warning: considering '0000000000 00000 n' as a free entry.

2011-06-30 Thread thiyagu rajan
Does anyone know why the below warnings are generated while processing the
   pdf files that are generated by splitting a odf using iText ?

 Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   Warning: considering '00 0 n' as a free entry.
   This file had errors that were repaired or ignored.
   The file was produced by:
    iText by lowagie.com (r1.02b;p128) 
   Please notify the author of the software that produced this
   file that it does not conform to Adobe's published PDF
   specification.

   Regards,
   Thiyaga.
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

[iText-questions] Invitation to connect on LinkedIn

2011-06-30 Thread Nelash jindal via LinkedIn
LinkedIn





Nelash jindal requested to add you as a connection on LinkedIn:
  
--

Pervaiz,

I'd like to add you to my professional network on LinkedIn.

- Nelash

Accept invitation from Nelash jindal
http://www.linkedin.com/e/-af3krs-gpk1dw9h-1n/TKe-S8pJ3Cwsn-F_TysNP8aEA28gS4kc78x9aQpEa8HbJmrDYVu0owJ/blk/I104974422_110/6lColZJrmZznQNdhjRQnOpBtn9QfmhBt71BoSd1p65Lr6lOfP0NclYOczgQdPAQc359bPh2mk9Lj7plbPsMdjwMdjoVcPcLrCBxbOYWrSlI/EML_comm_afe/

View invitation from Nelash jindal
http://www.linkedin.com/e/-af3krs-gpk1dw9h-1n/TKe-S8pJ3Cwsn-F_TysNP8aEA28gS4kc78x9aQpEa8HbJmrDYVu0owJ/blk/I104974422_110/c34NnP8Od3gTejgMckALqnpPbOYWrSlI/svi/
 
--

DID YOU KNOW you can showcase your professional knowledge on LinkedIn to 
receive job/consulting offers and enhance your professional reputation? Posting 
replies to questions on LinkedIn Answers puts you in front of the world's 
professional community.
http://www.linkedin.com/e/-af3krs-gpk1dw9h-1n/abq/inv-24/

 
-- 
(c) 2011, LinkedIn Corporation--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Re: [iText-questions] Why iText can not flatten new fields

2011-06-30 Thread Mark Storer
The underlying problem, as I understand it:
 
1) an AcroFields object is created when the PDF is opened.
2) newly created fields are not added to the existing AcroFields.
3) Flattening works on the information in the AcroFields.
 
All AcroFields.Item's modifier functions are package private, and there's no 
way to add an Item from outside the class an Oh Yes There Is.  
AcroFields.getFields just hands over its internal name->Item map, so if you 
could construct the proper Item object, you could trivially insert it.
 
Potential solutions (if I'm right):
1) 
  PdfReader reader = new PdfReader(...);
  PdfFormField formFieldDict = buildFormField(); // you'll have to manage that 
one on your own
  PRIndirectReference fieldRef = reader.addPdfObject(formFieldDict);
 
  // add it to the page
  PdfDictionary pageDict = reader.getPageN(pageNum);
  PdfArray annots = pageDict.getAsArray(PdfName.ANNOTS);
  if (annots == null) {
annots = new PdfArray();
pageDict.put(PdfName.ANNOTS, annots);
  }
  annots.add(fieldRef);
 
  // add it to the doc-level field list
  PdfDictionary root = reader.getCatalog();
  PdfDictionary acroFrm = root.getAsDict(PdfName.ACROFORM);
  PdfArray flds = acroFrm.getAsArray(PdfName.FIELDS);
  flds.add(fieldRef); // just tack it on the end.
 
  PdfStamper stamper = new PdfStamper(reader, outStream);
  ...
 
 
This method adds the field to the reader prior to the creation of the 
AcroFields object, so that when it works its way through the PDF, it finds your 
new field.
 
2) Modify your copy of the iText source to make the various 
AcroFields.Item.add* function public and use them to create a new 
AcroFields.Item and add it to the AcroFields' field map.
 
  AcroFields.Item item = new AcroFields.Item();
  item.addPage( pageNum );
  item.addWidget( formFieldDict );
  item.addWidgetRef( fieldRef );
  item.addValue( formFieldDict );
  item.addMerged( formFieldDict );
  item.addTabOrder( fldDictsIndexInAnnotsArray );
 
  acroFields.getFields().put(fldName, item);
  
 
--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 




From: José Carrizo [mailto:c4rr...@gmail.com] 
Sent: Wednesday, June 29, 2011 7:08 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Why iText can not flatten new fields



Well, actually there is a case where I need to do it but does not 
matter, you are right, I'll try to do it that way.

Thanks so much.


El jun 29, 2011 3:39 a.m., "1T3XT BVBA"  escribió:
>
> On 29/06/2011 1:55, José Carrizo wrote:
>>
>> Hello there,
>>
>> I would like to know why the code documentation of iText says "The 
fields added with addAnnotation(PdfAnnotation, int) will never be flattened".
>>
>> I need to do that, flatten a field that has been just created with 
iText, whats the reason for that restriction.
>
>
> 1. A field that has been added to an existing PDF can be flattened in 
a second pass.
> 2. It doesn't make sense to add a field, and then immediately flatten 
it. Just add the content!
>
> 
--
> All of the data generated in your IT infrastructure is seriously 
valuable.
> Why? It contains a definitive record of application performance, 
security
> threats, fraudulent activity, and more. Splunk takes this data and 
makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a 
reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please chec

Re: [iText-questions] How to extract title / heading from document contents

2011-06-30 Thread 1T3XT BVBA
On 30/06/2011 16:52, Michael O'Donovan wrote:
> perfect thanks. Using GetFont and it giving me the font names, albeit pretty
> cryptic. Now just need to figure how to get font size (which seems pretty
> hidden to me).
That's because the font size that is defined in the PDF syntax may not 
be the font size that is shown.

Why not?
Because the graphics state has an impact on the size of the glyphs.
If the CTM is defined in a way that all glyphs are scaled to 50%,
and the font size is defined as 18pt, than the actual font size is 9pt.

So...
To have an idea about the font size, you need to make a guess
based on the values for the baseline, ascender and descender.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Overlay of one PDF over another not working

2011-06-30 Thread 1T3XT BVBA
On 30/06/2011 19:31, Joseph Schmoley wrote:
>
> So I guess my question is what iText library call do I want to use to 
> check the document's current x/y setting so I can do the calculation?  
> And if you have any pointers on how this calculation is to be done, 
> that would be greatly helpful as well.
That's explained in chapter 5 of the book.
You need to get the CropBox.
If getCropBox() returns null, you need to get the MediaBox.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Overlay of one PDF over another not working

2011-06-30 Thread Joseph Schmoley
Thanks very much for your reply.  I think I understand your points, but have
further questions.

On Wed, Jun 29, 2011 at 12:41 PM, 1T3XT BVBA  wrote:

> I can see the overlay (it's added as /Xi6, object number 1 in the PDF),
> but it's not in the "visible area".
> This is how you added it: q 1 0 0 1 0 0 cm /Xi6 Do Q
> You've used coordinate 0,0, but in this case you should have used
> 0,12407.1.
>
>
Yes, I'm using PdfContentByte.addTemplate (overlayPage, 0, 0).  So I'm
wrongfully assuming that the base document uses coordinates 0,0.  So I guess
what I'm hearing from you is that I have to first examine the base document,
get the x/y coords it's using, then do the math to know what to pass into
addTemplate().  Is this correct?

In order to find out the dictionary embedded in the base.pdf file I tried
running PdfContentReaderTool against it but it caused an exception:

C:\test-app>run-class com.lowagie.text.pdf.parser.PdfContentReaderTool
test\base.pdf
java.lang.ArrayIndexOutOfBoundsException: Invalid index: 02
at
com.lowagie.text.pdf.CMapAwareDocumentFont.decodeSingleCID(Unknown Source)
at com.lowagie.text.pdf.CMapAwareDocumentFont.decode(Unknown Source)
at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.decode(Unknown Source)
at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.displayPdfString(Unknown
Source)
at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor$ShowTextArray.invoke(Unknown
Source)
at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.invokeOperator(Unknown
Source)
at
com.lowagie.text.pdf.parser.PdfContentStreamProcessor.processContent(Unknown
Source)
at
com.lowagie.text.pdf.parser.PdfTextExtractor.getTextFromPage(Unknown Source)
at
com.lowagie.text.pdf.parser.PdfContentReaderTool.listContentStreamForPage(Unknown
Source)
at
com.lowagie.text.pdf.parser.PdfContentReaderTool.listContentStream(Unknown
Source)
at com.lowagie.text.pdf.parser.PdfContentReaderTool.main(Unknown
Source)

Although when I view the file in Acrobat or open it in other tools it opens
just fine.

So I guess my question is what iText library call do I want to use to check
the document's current x/y setting so I can do the calculation?  And if you
have any pointers on how this calculation is to be done, that would be
greatly helpful as well.

Thanks again for your help.

Jac
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Re: [iText-questions] What to set while stamping the PDF for retaining tags described in PDF template

2011-06-30 Thread Mark Storer
> So you mean it is better to tag the PDF in java rather than 
> using tagged PDF?

That's right.

> Or it will only be possible to tag the text which is being 
> written on to the PDF using IText.

iText only supports adding tags to text/lines/images as it draws them.
It is Very Hard to modify a content stream properly.  You could wrap an
entire template in a single tag easily enough.  Adding tags inside that
template is practically beyond your reach.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer DisCard = null;
 
 

> -Original Message-
> From: priyankasinha [mailto:priyanka16.2...@gmail.com] 
> Sent: Thursday, June 30, 2011 4:03 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] What to set while stamping the 
> PDF for retaining tags described in PDF template
> 
> Thanks for your reply Mark.
> I am using JAWS for screen reading through the PDF.
> Ok so If I have to tag the PDF in java using Itext then can 
> it tag the text coming from PDF template?

> 
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/What-to-set-while-s
tamping-the-PDF-for-retaining-tags-described-in-PDF-template->
tp3632881p3635342.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --
> 
> All of the data generated in your IT infrastructure is 
> seriously valuable.
> Why? It contains a definitive record of application 
> performance, security threats, fraudulent activity, and more. 
> Splunk takes this data and makes sense of it. IT sense. And 
> common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered 
> with a reference to the iText book: 
> http://www.itextpdf.com/book/ Please check the keywords list 
> before you ask for examples: http://itextpdf.com/themes/keywords.php
> 
> 

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


[iText-questions] background-color in itext xmlworker

2011-06-30 Thread rafael.nunes
I'm doing parse html to pdf using itext xmlworker, but I see that when I put
this tag

ladhasgdjhsagdsha

the itext does not perform to parse pdf. I read the documentation itext
xmlworker 

[http://demo.itextsupport.com/xmlworker/itextdoc/index.html] 

and I see that is supported by itext. 

Anyone ever had this problem?

thanks

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/background-color-in-itext-xmlworker-tp3635526p3635526.html
Sent from the iText - General mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Tables and borders

2011-06-30 Thread Emiel Ackermann
In Java, I would instantiate the cell and disable the border of the cell 
with:


cell.setBorder(Rectangle.NO_BORDER);

before returning it within your method

private PdfPCell NewCell(string text, FaxFonts font, int colspan)
{
return new PdfPCell(new Phrase(text, 
_fonts[(int)font].Font)) { Colspan = colspan };

}
Op 30/06/2011 13:18, hhn000 schreef:
It seems that the problem is that I'm using new PDFPCell to create the 
new cell instead of using AddCell(Phrase), so it doesn't know about 
the table.


But if I create the new cell from table.DefaultCell, doesn't it create 
a copy of the table? which gets thrown away when adding the cell with 
AddCell(PDFPCell).


The easiest solution would be if AddCell(Phrase) returned the newly 
added cell, so I could adjust the colspan... but then AddCell looks to 
need to know about it when adding the cell...


Some kind of factory method that returns a PDFPCell suitable for 
addition with AddCell() without any unnecessary overhead would be nice.


Did I miss something? Or do something in a wrong way?

On Thu, Jun 30, 2011 at 09:42, hhn000 > wrote:


Does anyone have any ideas about the problem? I have checked the
source, but I can't see any difference between AddCell(string) and
AddCell(new PDFPCell(new Phrase(string, font). If so, the only
change is the Colspan, I haven't checked the generation from the
table, but there doesn't seem to be any obvious reason why that
would affect the borders (at least to me without reading the code).

Any help would be much appreciated.


On Wed, Jun 29, 2011 at 11:14, hhn000 mailto:hhn...@gmail.com>> wrote:

Ok, I'm adding the rows using the following code:

public void DrawBlock(ITextColumns block)

{
var table = new PdfPTable(block.Widths);
table.WidthPercentage = 100f;
table.DefaultCell.Border = Rectangle.NO_BORDER;

AddRows(table, block.Spans1, block.Rows1,
block.Fonts);
AddRows(table, block.Spans2, block.Rows2,
block.Fonts);

_document.Add(table);
}

private void AddRows(PdfPTable table, int[] spans,
List rows, FaxFonts[] fonts)
{
foreach (var row in rows)
{
var j = 0;
for (var i = 0; i < spans.Length; i++)
if (spans[i] > 0)
{
table.AddCell(NewCell(row[j],
fonts[i], spans[i]));
j++;
}
}
}

private PdfPCell NewCell(string text, FaxFonts font,
int colspan)
{
return new PdfPCell(new Phrase(text,
_fonts[(int)font].Font)) { Colspan = colspan };
}

In AddRows spans look like { 1, 1, 1, 1, 1, 1 } or { 4, 0, 0,
0, 1, 1 }
Each row like { "col1", "col2", "col3", "col4", "col5", "col6"
} or { "col1", "col2", "col3", "col4" } for the above spans.

IIRC i was using table.AddCell(row[i]) when it didn't show the
borders earlier.


On Wed, Jun 29, 2011 at 10:47, 1T3XT BVBA mailto:i...@1t3xt.info>> wrote:

On 29/06/2011 9:24, hhn000 wrote:
>
> Does anyone have any idea of what I'm doing wrong?
We don't have sufficient information to answer that question.
1. You say that you initially turned borders off and it
worked.
2. Then you turned them on and it worked.
3. Now you turned them back off and it no longer works.
We don't know what else you changed in 2.
Maybe you've started working with PdfPCell objects instead
of just the
addCell() method.
Only you know, so we don't have the answer: you have.


--
All of the data generated in your IT infrastructure is
seriously valuable.
Why? It contains a definitive record of application
performance, security
threats, fraudulent activity, and more. Splunk takes this
data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will

Re: [iText-questions] How to extract title / heading from document contents

2011-06-30 Thread Michael O'Donovan
perfect thanks. Using GetFont and it giving me the font names, albeit pretty 
cryptic. Now just need to figure how to get font size (which seems pretty 
hidden to me).

Thanks

-Original Message- 
From: 1T3XT BVBA
Sent: Wednesday, June 29, 2011 10:36 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] How to extract title / heading from document 
contents

On 28/06/2011 18:27, Michael O'Donovan wrote:
> I have the book and looked through chapter 15. However in the section
> (15.3.2) about using  PdfContentSteamProcessor the code samples only 
> extract
> raw text
For instance in listing 15.24 using the getText() method of the
RenderInfo class.
This class also has a getFont() method, a getBaseline() method, etc...

Those are the methods you'll need, but it isn't going to be easy unless
your PDFs are very straight-forward.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a 
reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php 


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Tables and borders

2011-06-30 Thread hhn000
It seems that the problem is that I'm using new PDFPCell to create the new
cell instead of using AddCell(Phrase), so it doesn't know about the table.

But if I create the new cell from table.DefaultCell, doesn't it create a
copy of the table? which gets thrown away when adding the cell with
AddCell(PDFPCell).

The easiest solution would be if AddCell(Phrase) returned the newly added
cell, so I could adjust the colspan... but then AddCell looks to need to
know about it when adding the cell...

Some kind of factory method that returns a PDFPCell suitable for addition
with AddCell() without any unnecessary overhead would be nice.

Did I miss something? Or do something in a wrong way?

On Thu, Jun 30, 2011 at 09:42, hhn000  wrote:

> Does anyone have any ideas about the problem? I have checked the source,
> but I can't see any difference between AddCell(string) and AddCell(new
> PDFPCell(new Phrase(string, font). If so, the only change is the Colspan, I
> haven't checked the generation from the table, but there doesn't seem to be
> any obvious reason why that would affect the borders (at least to me without
> reading the code).
>
> Any help would be much appreciated.
>
>
> On Wed, Jun 29, 2011 at 11:14, hhn000  wrote:
>
>> Ok, I'm adding the rows using the following code:
>>
>> public void DrawBlock(ITextColumns block)
>>
>> {
>> var table = new PdfPTable(block.Widths);
>> table.WidthPercentage = 100f;
>> table.DefaultCell.Border = Rectangle.NO_BORDER;
>>
>> AddRows(table, block.Spans1, block.Rows1, block.Fonts);
>> AddRows(table, block.Spans2, block.Rows2, block.Fonts);
>>
>> _document.Add(table);
>> }
>>
>> private void AddRows(PdfPTable table, int[] spans, List
>> rows, FaxFonts[] fonts)
>> {
>> foreach (var row in rows)
>> {
>> var j = 0;
>> for (var i = 0; i < spans.Length; i++)
>> if (spans[i] > 0)
>> {
>> table.AddCell(NewCell(row[j], fonts[i],
>> spans[i]));
>> j++;
>> }
>> }
>> }
>>
>> private PdfPCell NewCell(string text, FaxFonts font, int colspan)
>> {
>> return new PdfPCell(new Phrase(text, _fonts[(int)font].Font))
>> { Colspan = colspan };
>> }
>>
>> In AddRows spans look like { 1, 1, 1, 1, 1, 1 } or { 4, 0, 0, 0, 1, 1 }
>> Each row like { "col1", "col2", "col3", "col4", "col5", "col6" } or {
>> "col1", "col2", "col3", "col4" } for the above spans.
>>
>> IIRC i was using table.AddCell(row[i]) when it didn't show the borders
>> earlier.
>>
>>
>> On Wed, Jun 29, 2011 at 10:47, 1T3XT BVBA  wrote:
>>
>>> On 29/06/2011 9:24, hhn000 wrote:
>>> >
>>> > Does anyone have any idea of what I'm doing wrong?
>>> We don't have sufficient information to answer that question.
>>> 1. You say that you initially turned borders off and it worked.
>>> 2. Then you turned them on and it worked.
>>> 3. Now you turned them back off and it no longer works.
>>> We don't know what else you changed in 2.
>>> Maybe you've started working with PdfPCell objects instead of just the
>>> addCell() method.
>>> Only you know, so we don't have the answer: you have.
>>>
>>>
>>> --
>>> All of the data generated in your IT infrastructure is seriously
>>> valuable.
>>> Why? It contains a definitive record of application performance, security
>>> threats, fraudulent activity, and more. Splunk takes this data and makes
>>> sense of it. IT sense. And common sense.
>>> http://p.sf.net/sfu/splunk-d2d-c2
>>> ___
>>> iText-questions mailing list
>>> iText-questions@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>>
>>> iText(R) is a registered trademark of 1T3XT BVBA.
>>> Many questions posted to this list can (and will) be answered with a
>>> reference to the iText book: http://www.itextpdf.com/book/
>>> Please check the keywords list before you ask for examples:
>>> http://itextpdf.com/themes/keywords.php
>>>
>>
>>
>
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keyword

Re: [iText-questions] What to set while stamping the PDF for retaining tags described in PDF template

2011-06-30 Thread priyankasinha
Thanks for your reply Mark.
I am using JAWS for screen reading through the PDF.
So you mean it is better to tag the PDF in java rather than using tagged
PDF?
Ok so If I have to tag the PDF in java using Itext then can it tag the text
coming from PDF template?
Or it will only be possible to tag the text which is being written on to the
PDF using IText.

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/What-to-set-while-stamping-the-PDF-for-retaining-tags-described-in-PDF-template-tp3632881p3635342.html
Sent from the iText - General mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] What to set while stamping the PDF for retaining tags described in PDF template

2011-06-30 Thread priyankasinha
Thanks for your reply Mark.
I am using JAWS for screen reading through the PDF.
So you mean it is better to tag the PDF in java rather than using tagged
PDF?
Ok so If I have to tag the PDF in java using Itext then can it tag the text
coming from PDF template?
Or it will only be possible to tag the text which is being written on to the
PDF using IText.

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/What-to-set-while-stamping-the-PDF-for-retaining-tags-described-in-PDF-template-tp3632847p3635341.html
Sent from the iText - General mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] Tables and borders

2011-06-30 Thread hhn000
Does anyone have any ideas about the problem? I have checked the source, but
I can't see any difference between AddCell(string) and AddCell(new
PDFPCell(new Phrase(string, font). If so, the only change is the Colspan, I
haven't checked the generation from the table, but there doesn't seem to be
any obvious reason why that would affect the borders (at least to me without
reading the code).

Any help would be much appreciated.

On Wed, Jun 29, 2011 at 11:14, hhn000  wrote:

> Ok, I'm adding the rows using the following code:
>
> public void DrawBlock(ITextColumns block)
>
> {
> var table = new PdfPTable(block.Widths);
> table.WidthPercentage = 100f;
> table.DefaultCell.Border = Rectangle.NO_BORDER;
>
> AddRows(table, block.Spans1, block.Rows1, block.Fonts);
> AddRows(table, block.Spans2, block.Rows2, block.Fonts);
>
> _document.Add(table);
> }
>
> private void AddRows(PdfPTable table, int[] spans, List
> rows, FaxFonts[] fonts)
> {
> foreach (var row in rows)
> {
> var j = 0;
> for (var i = 0; i < spans.Length; i++)
> if (spans[i] > 0)
> {
> table.AddCell(NewCell(row[j], fonts[i], spans[i]));
> j++;
> }
> }
> }
>
> private PdfPCell NewCell(string text, FaxFonts font, int colspan)
> {
> return new PdfPCell(new Phrase(text, _fonts[(int)font].Font)) {
> Colspan = colspan };
> }
>
> In AddRows spans look like { 1, 1, 1, 1, 1, 1 } or { 4, 0, 0, 0, 1, 1 }
> Each row like { "col1", "col2", "col3", "col4", "col5", "col6" } or {
> "col1", "col2", "col3", "col4" } for the above spans.
>
> IIRC i was using table.AddCell(row[i]) when it didn't show the borders
> earlier.
>
>
> On Wed, Jun 29, 2011 at 10:47, 1T3XT BVBA  wrote:
>
>> On 29/06/2011 9:24, hhn000 wrote:
>> >
>> > Does anyone have any idea of what I'm doing wrong?
>> We don't have sufficient information to answer that question.
>> 1. You say that you initially turned borders off and it worked.
>> 2. Then you turned them on and it worked.
>> 3. Now you turned them back off and it no longer works.
>> We don't know what else you changed in 2.
>> Maybe you've started working with PdfPCell objects instead of just the
>> addCell() method.
>> Only you know, so we don't have the answer: you have.
>>
>>
>> --
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2d-c2
>> ___
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>
>> iText(R) is a registered trademark of 1T3XT BVBA.
>> Many questions posted to this list can (and will) be answered with a
>> reference to the iText book: http://www.itextpdf.com/book/
>> Please check the keywords list before you ask for examples:
>> http://itextpdf.com/themes/keywords.php
>>
>
>
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php