Re: [iText-questions] Tables and borders

2011-07-01 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
emiel.ackerm...@beanpole.bewrote:

 **
 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 hhn...@gmail.com 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 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, Liststring[]
 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 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

Re: [iText-questions] Tables and borders

2011-07-01 Thread hhn000
Yes, I do. and it's not very different from a factory method that copies the
table.DefaultCell. I think I just need to read more :-).

On Fri, Jul 1, 2011 at 08:59, 1T3XT BVBA i...@1t3xt.info wrote:

 On 1/07/2011 8:50, hhn000 wrote:
  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)
 Yes, but suppose you have a table with plenty of normal cells (that
 need the default behavior), and only a couple of special cells (that
 need to be different from the default).
 How would you override the default cell for these special cells?
 All our own applications use the default cell for quick results. We use
 PdfPCell (and its properties) whenever we need to make a difference.
 Sometimes, we use the copy constructor of PdfPCell to create an empty
 cell with the same properties as the default cell:
 PdfPCell cell = new PdfPCell(table.getDefaultCell());
 This way, we don't have to copy all the properties of the default cell
 manually (that's not the correct work, but you probably know what I
 mean).


 --
 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
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 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, Liststring[]
 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 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) 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 hhn...@gmail.com 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 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, Liststring[]
 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 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) 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] Tables and borders

2011-06-29 Thread hhn000
Hi,

I'm using iTetSharp 5.0.6.

While creating some tables for a document (actually a list of items
formatted using a PDFPTable), I initially turned off the borders on the
tables' DefaultCell, then turned it back on, for debugging purposes, and now
they stay on even though I set the table's DefaultCell.Border to 0 or
Rectagle.NO_BORDER

This is the code I use to create each table:

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

// insert data into the cells

_document.Add(table);

block.Widths is an array of floats, the column widths in points.

Does anyone have any idea of what I'm doing wrong?
--
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-29 Thread hhn000
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, Liststring[]
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 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) 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] C# embedded fonts

2011-06-22 Thread hhn000
Hi,

from what I can see in
http://www.mikesdotnetting.com/Article/81/iTextSharp-Working-with-Fonts the
following line should embed a named font (and create a Font object suitable
for use in a Paragraph)

Font = FontFactory.GetFont(name, BaseFont.CP1252, BaseFont.EMBEDDED, size);

except that the resulting pdf doesn't seem to contain any font objects
besides a standard helvetica

1 0 obj
/Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding
endobj

exactly the same I get when using

Font = FontFactory.GetFont(name, size);

Am I missing some setup? This is basically my initialization:

public static string[] FontFamily = { Arial, Courier, Arial
Bold, Arial Bold,  Arial Black, Arial Bold, Arial Bold, Arial };

_fonts = new ListPdfFont();
var length = Math.Min(FontFamily.Length, FontSize.Length);
for (var i = 0; i  length; i++)
_fonts.Add(new PdfFont(FontFamily[i], FontSize[i]));
_document = new Document(PageSize.A4);
_stream = new MemoryStream();
_writer = PdfWriter.GetInstance(_document, _stream);
_document.Open();

--No1
--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000
It seems that somewhere between 2008 when Mike wrote his articles and now,
that the default font directories aren't automatically registered :-( Are
there plans to document the iTextSharp project? It seems counterproductive
that every developer has to reverse engineer the library.

On Wed, Jun 22, 2011 at 09:08, hhn000 hhn...@gmail.com wrote:

 Hi,

 from what I can see in
 http://www.mikesdotnetting.com/Article/81/iTextSharp-Working-with-Fontsthe 
 following line should embed a named font (and create a Font object
 suitable for use in a Paragraph)

 Font = FontFactory.GetFont(name, BaseFont.CP1252, BaseFont.EMBEDDED, size);

 except that the resulting pdf doesn't seem to contain any font objects
 besides a standard helvetica

 1 0 obj
 /Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding
 endobj

 exactly the same I get when using

 Font = FontFactory.GetFont(name, size);

 Am I missing some setup? This is basically my initialization:

 public static string[] FontFamily = { Arial, Courier, Arial
 Bold, Arial Bold,  Arial Black, Arial Bold, Arial Bold, Arial };

 _fonts = new ListPdfFont();
 var length = Math.Min(FontFamily.Length, FontSize.Length);
 for (var i = 0; i  length; i++)
 _fonts.Add(new PdfFont(FontFamily[i], FontSize[i]));
 _document = new Document(PageSize.A4);
 _stream = new MemoryStream();
 _writer = PdfWriter.GetInstance(_document, _stream);
 _document.Open();

 --No1

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000

 On 22/06/2011 9:08, hhn000 wrote:
  Hi,
 
  from what I can see in
  http://www.mikesdotnetting.com/Article/81/iTextSharp-Working-with-Fontsthe
  following line should embed a named font (and create a Font object
  suitable for use in a Paragraph)
 
  Font = FontFactory.GetFont(name, BaseFont.CP1252, BaseFont.EMBEDDED,
  size);
 
  except that the resulting pdf doesn't seem to contain any font objects
  besides a standard helvetica
 
  1 0 obj
  /Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding
  endobj
 
  exactly the same I get when using
 
  Font = FontFactory.GetFont(name, size);
 
  Am I missing some setup?

 You didn't read the full article. You missed the part about registering
 fonts.

 int totalfonts = FontFactory.RegisterDirectory(C:\\WINDOWS\\Fonts);

 You can only use font names that are RegisteredFonts in the FontFactory:

 StringBuilder sb = new StringBuilder();
 foreach (string fontname in FontFactory.RegisteredFonts) {
   sb.Append(fontname + \n);
 }
 doc.Add(new Paragraph(All Fonts:\n + sb.ToString()));


 Please don't use iText without reading the official documentation:
 http://itextpdf.com/book/


I did read the full article including the passage: !Each time that you call
FontFactory.GetFont(), a new Font object is created. This method will work
directly with all fonts registered by iTextSharp, which includes all fonts
found in the Windows default font directory. On Win XP Pro, that's usually
C:/WINDOWS/Fonts. which seem to imply that iTextSharp automatically
registers all fonts found in the Windows default font directory (direct
quote).
--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000

 On 22/06/2011 10:26, hhn000 wrote:
  Are there plans to document the iTextSharp project?
 There's a 386 page book about iText!
 OK, that's about the Java version, but most of the examples were ported to
 C#.
 Are you saying there's a lack of documentation? If so, are you a troll?
 HAND


Yes, it IS about Java.

I didn't ask about the Java version, I am aware of the book, but until
Amazon can deliver dead trees instantly, it still takes time to get it in my
hands, right?

And that still doesn't answer the question about the C# version. Not sure if
I got the wrong version off SF, but I don't have ANY description of the
methods in intellisense, not even what the return value of
FontFactory.RegistrerDirectories() is... I do think that could be improved
(unless I messed up).

The javadoc, (i.e.
http://api.itextpdf.com/itext/com/itextpdf/text/Paragraph.html#alignment)
could include a bit more information (like a list of the valid values,
constants in this case, so I wouldn't have to consult the source code), this
might be a limitation of the system.

NO! I'm not saying that there is no documentation of iText.

YES! I am saying that there is little, or outdated documentation of
iTextSharp! I haven't read the book, so I don't know the extent of the
differences between the book and the implementation of iTextSharp, but if
there are differences I can hardly be called documentation of the C#
version.

No I'm not a troll, I do believe that I'm correct about the amount of
documentation, and you haven't provided any evidence to disprove it.Isn't
calling anyone with another opinion than your own a troll, itself the
actions of a troll? If so, are you a troll?

I'm sorry but I don't understand the acronym.
--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000
No, I didn't reverse engineer the entire library, and having the source
doesn't exactly eliminate the need to extract information about the library
(what is normally in the documentation) the hard way, just makes it easier.

Proper documentation = the book? As I've said delivery is not instant.

On Wed, Jun 22, 2011 at 10:56, Paulo Soares psoa...@glintt.com wrote:

 **
 Font registration has always been the same in Java and C#. As  for
 documentation, two book were written about iText and although they are for
 Java 99% also applies to C# and most of the example were ported in
 http://kuujinbo.info/iTextInAction2Ed/index.aspx. If you have to reverse
 engineer the library (an interesting concept, considering the you have the
 sources) you didn't care look for the proper documentation.

 Paulo

 - Original Message -
 *From:* hhn000 hhn...@gmail.com
 *To:* itext-questions@lists.sourceforge.net
 *Sent:* Wednesday, June 22, 2011 9:26 AM
 *Subject:* Re: [iText-questions] C# embedded fonts

 It seems that somewhere between 2008 when Mike wrote his articles and now,
 that the default font directories aren't automatically registered :-( Are
 there plans to document the iTextSharp project? It seems counterproductive
 that every developer has to reverse engineer the library.

 On Wed, Jun 22, 2011 at 09:08, hhn000 hhn...@gmail.com wrote:

 Hi,

 from what I can see in
 http://www.mikesdotnetting.com/Article/81/iTextSharp-Working-with-Fontsthe 
 following line should embed a named font (and create a Font object
 suitable for use in a Paragraph)

 Font = FontFactory.GetFont(name, BaseFont.CP1252, BaseFont.EMBEDDED,
 size);

 except that the resulting pdf doesn't seem to contain any font objects
 besides a standard helvetica

 1 0 obj
 /Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding
 endobj

 exactly the same I get when using

 Font = FontFactory.GetFont(name, size);

 Am I missing some setup? This is basically my initialization:

 public static string[] FontFamily = { Arial, Courier, Arial
 Bold, Arial Bold,  Arial Black, Arial Bold, Arial Bold, Arial };

 _fonts = new ListPdfFont();
 var length = Math.Min(FontFamily.Length, FontSize.Length);
 for (var i = 0; i  length; i++)
 _fonts.Add(new PdfFont(FontFamily[i], FontSize[i]));
 _document = new Document(PageSize.A4);
 _stream = new MemoryStream();
 _writer = PdfWriter.GetInstance(_document, _stream);
 _document.Open();

 --No1




 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 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

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000
By the official documentation you mean the iText book, right? and you also
think that it is documentation about the C# version, iTextSharp?

I'm saying that the actual C# documentation, written about C# is very hard
to find if it exists outside the book about the Java version. If you have
any links, please share.

From http://itextsharp.com/

Tutorials for Learning iTextSharp

Although the official documentation contains tutorials for Java developers
only, .NET developers should find iText in Action a useful introduction to
iTextSharp.


Am I insulting the author of a book, by asking a question about something,
that's plainly stated on the front page of the project? Either I didn't
insult him (which certainly wasn't my intention) or he should have a word
with the administrators of that page first.

On Wed, Jun 22, 2011 at 11:02, 1T3XT BVBA i...@1t3xt.info wrote:

 On 22/06/2011 10:46, hhn000 wrote:
  I did read the full article
 1. That article isn't part of the official documentation. It's a blog
 written by a user. Please refer to the official documentation before you
 say things such as Are there plans to document the iTextSharp project?

 Or are you saying the official documentation says something else?
 (If you don't own a copy of the book, please don't insult its author by
 saying his documentation isn't clear!)


 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 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

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000
Not in this specific case, Paragraph.alignment. From Element.cs:

public const int ALIGN_UNDEFINED = -1;
public const int ALIGN_LEFT = 0;
public const int ALIGN_CENTER = 1;
public const int ALIGN_RIGHT = 2;


On Wed, Jun 22, 2011 at 11:09, 1T3XT BVBA i...@1t3xt.info wrote:

 On 22/06/2011 11:03, hhn000 wrote:
  like a list of the valid values, constants in this case
 That's impossible, isn't it?
 The constants depend on the fonts in the directories you register.
 Typically, the list of valid values will be much shorter on American
 versions of Windows than on European versions.
 If you register a font directory on Linux, you will get totally
 different fonts (Nimbus instead of Times, etc...).

 As for the acronym: HAND means Have A Nice Day.


 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 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

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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] C# embedded fonts

2011-06-22 Thread hhn000
Ok, My story is straight, but my facts were off somewhat, sorry about that.

But I didn't claim that it was your site.

Are these facts correct? (I don't want to troll or insult anyone, but would
like to clear up the facts)

iTextSharp is developed by 1T3XT or iText Software Corp?

The documentation for C# developers is:
- the book iText in Action
- the javadoc
- the examples converted to C#

Is there any other official resources that I've missed?

On Wed, Jun 22, 2011 at 11:26, 1T3XT BVBA i...@1t3xt.info wrote:

 **
  You are assuming that itextsharp.com is owned by 1T3XT or iText Software
 Corp.
 It isn't. itextsharp.com was registered by somebody we'll probably have to
 sue someday.
 The official iText page is http://itextpdf.com/
 Again, you are complaining against the REAL iText people referring to
 UNOFFICIAL information.
 Please get your story straight!!!


--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev___
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