1

This is the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using sharpPDF;

namespace Lightnings_Extractor
{
    class PDF
    {
        pdfDocument myDoc = new pdfDocument("Lightnings-Graphs", "Daniel");

        public PDF()
        {
            pdfPage myPage = myDoc.addPage();
            myPage.addText("Hello World!", 200, 450, predefinedFont.csHelvetica, 20);
            myDoc.createPDF(@"d:\mypdf.pdf");
            myPage = null;
            myDoc = null;
        }

    }
}

predefinedFont does not exist.

So I tried to write:

sharpPDF.Fonts.pdfAbstractFont font;

But then when I tried to create font, there is no csHelvetica

What am I missing here ?

Daniel Lip
  • 3,867
  • 7
  • 58
  • 120
  • You have missed that you are not using PDFsharp. You are using sharpPDF. – I liked the old Stack Overflow Dec 16 '12 at 21:17
  • Right. Now i have downloaded the PDFSharp. But i can't find any dll. This is strange i have to compile now it on my own to build a dll file of the PDFSharp ?! I downloaded it from here: http://sourceforge.net/projects/pdfsharp/files/pdfsharp/PDFsharp%201.32/ the second file the 4.2mb file. And there is no any dll file/s. – Daniel Lip Dec 16 '12 at 21:27
  • Ok found it had to download the second file. Thnaks. – Daniel Lip Dec 16 '12 at 21:39

3 Answers3

0

I used sharpPDF in mistake. I have downloaded now PDFsharp.

Thanks.

Daniel Lip
  • 3,867
  • 7
  • 58
  • 120
0

Replace the following line by

      myPage.addText("Hello World!", 200, 450, predefinedFont.csHelvetica, 20);

by

      myPage.addText("Hello World!", 200, 450, myDoc.getFontReference(predefinedFont.csHelvetica), 20);

It works for me.

-1

Try replacing predefinedFont.csHelvetica with myDoc.getFontReference("Helvetica")

fish2000
  • 4,289
  • 2
  • 37
  • 76