Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3 Itext Chunks not working in Latest versions (1.2.1 and 1.3.0

closed-works-for-me
nobody
None
5
2005-05-30
2005-05-06
Anonymous
No

Hi

I noticed that chhunks are working in previous version
that I downloaded long long back.

BUt after doenlaoding new vesrion ,they are not working.
I dont see any data on Pdf when I use chunks.
I could see data when I use Phrases with out chunks.

thx

Discussion

  • Kazuya Ujihara
    Kazuya Ujihara
    2005-05-09

    • status: open --> closed
     
  • Logged In: NO

    Are you able to RUN Chap0201a.cs example with latest
    version of itext?

    When I run ,its throwing some exceptions

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2005-05-26

    Logged In: YES
    user_id=734754

    Install iTextdotNET-demo-???.msi and click 'Execute iText
    .NET C# Examples' shortcut on your desktop. It may produce
    Chap0201a.pdf correctly. It just checked using
    iTextdotNET-demo-1.3.1-1.msi and iTextdotNET-demo-1.2.1-1.msi.

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2005-05-26

    • status: closed --> open
     
  • Kazuya Ujihara
    Kazuya Ujihara
    2005-05-30

    • status: open --> closed-works-for-me
     
  • Logged In: NO

    hi,

    I will try what you said.

    FYI, this is what I tried with diffrent versions.
    Its working correctly with old version of ITEXT and but its
    raising an exception with new version.
    (Its not working only when I used add object of the phrase to
    add chunks)
    The below is the programme.

    Console.WriteLine("Chapter 2 example 1: Horizontal space in
    Paragraphs");

    Document.compress = true;
    Document document = new
    Document();
    PdfWriter writer =
    PdfWriter.getInstance(document, new FileOutputStream
    ("c:\\testing\\Chap0201a.pdf"));
    document.open();
    Phrase p1 = new Phrase();
    BaseFont F =
    BaseFont.createFont
    ("D:\\projects\\PDFEngine\\Resources\\fonts\\MtBdLfRg.ttf",
    BaseFont.CP1250, BaseFont.EMBEDDED);
    Font f1=new Font(F,8);
    Chunk ck = new Chunk(" As
    we can see the clashing is fixed for Images and",f1);
    p1.add(ck);
    ck = new Chunk(" oversized
    font chunks", f1);
    p1.add(ck);
    ck = new Chunk
    ("superscirpt",f1).setTextRise(9);
    p1.add(ck);
    ck = new Chunk(") text! ",f1);
    p1.add(ck);
    document.add(p1);
    document.close();

     
  • Kazuya Ujihara
    Kazuya Ujihara
    2005-05-31

    Logged In: YES
    user_id=734754

    Report error with the details such as where and what thrown.
    And don't post a sample code using non standard resources
    like MtBdLfRg.ttf.
    I don' t know what is MtBdLfRg.ttf. So I used times.ttf
    instead of MtBdLfRg.ttf.
    Anyway, the following code works for me.

    using System;
    using com.lowagie.text;
    using com.lowagie.text.pdf;
    using java.io;
    using System.IO;

    class Class1
    {
    [STAThread]
    static void Main(string[] args)
    {
    Document.compress = true;
    Document document = new
    Document();
    PdfWriter writer =
    PdfWriter.getInstance(document, new
    FileOutputStream ("test.pdf"));
    document.open();
    Phrase p1 = new Phrase();
    BaseFont F =
    BaseFont.createFont

    (Path.Combine((string)Microsoft.Win32.Registry.CurrentUser.
    OpenSubKey("Software").
    OpenSubKey("Microsoft").
    OpenSubKey("Windows").
    OpenSubKey("CurrentVersion").
    OpenSubKey("Explorer").
    OpenSubKey("Shell Folders").
    GetValue("Fonts"),
    "times.ttf"),
    BaseFont.CP1250, BaseFont.EMBEDDED);
    Font f1=new Font(F,8);
    Chunk ck = new Chunk(" As we can see the clashing is
    fixed for Images and",f1);
    p1.add(ck);
    ck = new Chunk(" oversized font chunks", f1);
    p1.add(ck);
    ck = new Chunk("superscirpt",f1).setTextRise(9);
    p1.add(ck);
    ck = new Chunk(") text! ",f1);
    p1.add(ck);
    document.add(p1);
    document.close();
    }
    }