I will get the matrix approach to work.
 
I have made good progress with the image approach, I am able to write data using ColumnText but I am facing a problem in Fonts. my acrofields have fonts, and font style specified on them.
 
when I write text using ColumnText I should use the same Font and style. I am not able to extract the Font information from the Acrofield. Here is what I have done so far
 

foreach (PdfDictionary dict in item.merged)
{
  foreach(PdfName name in dict.Keys)
  {
    if (name.ToString() == "/AP")
    {
      PdfDictionary fontDict = (PdfDictionary)dict.Get(name);
      foreach (PdfName name2 in fontDict.Keys)
      {
        if (fontDict.Get(name2).IsIndirect())
        {
          Console.WriteLine("indirect found");
          PRIndirectReference obj = (PRIndirectReference)fontDict.Get(name2);
          PRStream stream = (PRStream) PdfReader.GetPdfObject(obj);

          Console.WriteLine(stream.GetType().Name);

          foreach (PdfName o in stream.Keys)
          {
            Console.WriteLine("{0} {1}", o.ToString(), stream.Get(o));
          }
          PRTokeniser token = new PRTokeniser(stream.GetBytes ());
          while (token.NextToken())
          {
            if (token.TokenType == PRTokeniser.TK_STRING) Console.WriteLine(token.ToString());
          }
          Console.WriteLine(obj.Type);               
        }
      }
    }
  }

but the above code does not work and it throws a null pointer exception.
 
regards,
Abhishek.

 
On 8/8/06, bruno <[EMAIL PROTECTED]> wrote:
Abhishek Srivastava wrote:

> Thanks Bruno,
>
> The image approach works for me.
>
> However I want to compare it to the addTemplate apporach.
>
> if a co-ordinate is X1, Y1 in portait, then it becomes Y1,
> PageSize.A4.Width - X1 when the page becomes landscape.
>
> Given the above, what transformation matrix should be applied? so that
> the template is added correctly?

The problem you had is that the template is rotated outside the page.
I don't have the time to look it up right now, but it is just a matter of
applying some high school algebra. You can find the formulas here:
http://itextdocs.lowagie.com/tutorial/directcontent/coordinates/index.html#transform
br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to