PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 9:20 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Mar 05, 2014 1:54 pm 
Offline

Joined: Wed Mar 05, 2014 1:46 pm
Posts: 3
Hello, i have a problem. I'm trying to start with hello world but i have error, i enclose a photo screen. Please help me.


Attachments:
error.jpg
error.jpg [ 91.67 KiB | Viewed 6525 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 05, 2014 1:59 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

Instead of uploading a bitmap, better click on Copy exception detail to the clipboard and paste the text.

A DLL (PdfSharp-WPF.DLL) cannot be found.
Maybe a deployment problem?

Please provide an SSCCE that allows to replicate the problem.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 06, 2014 6:45 am 
Offline

Joined: Wed Mar 05, 2014 1:46 pm
Posts: 3
Hi,
I'm using PDFSharp, WPF bulid in 1.32 version. I want to move from a basic Hello World - write text to pdf.

It's "my" code:
Code:
using System;

using System.Diagnostics;

using System.IO;

using PdfSharp;

using PdfSharp.Drawing;

using PdfSharp.Pdf;

using PdfSharp.Pdf.IO;

 

namespace HelloWorld

{

class Program

{

static void Main(string[] args)

{

// Create a new PDF document

PdfDocument document = new PdfDocument();

document.Info.Title = "Created with PDFsharp";

PdfPage page = document.AddPage();

XGraphics gfx = XGraphics.FromPdfPage(page);

 

// Create a font

XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);

 

// Draw the text

gfx.DrawString("Hello, World!", font, XBrushes.Black,

new XRect(0, 0, page.Width, page.Height),

XStringFormats.Center);

 

// Save the document...

const string filename = "HelloWorld.pdf";

document.Save(filename);

// ...and start a viewer.

Process.Start(filename);

}

}
}

In REFERENCES i include PDFsharp-WPF.dll and WindowsBase.dll.
In build i don't have errors but i trying run program i have problem:

{"Nie można załadować pliku lub zestawu (beginning English: Error FileNotFoundException) 'PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb' lub jednej z jego zależności. Nie można odnaleźć określonego pliku.":"PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb"}


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 06, 2014 9:08 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Most likely this is a deployment problem.

Where do you compile the program?
Where do you run it?
How do you deploy it?

The code snippet you are showing is irrelevant for the problem you have.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 06, 2014 11:15 am 
Offline

Joined: Wed Mar 05, 2014 1:46 pm
Posts: 3
Ok, succedded! 8)
My problem was bad deployment. I'm write programs microcontrollers in C, i never programs in C#, Visual Studio,further my english is very little and i have big problem when i'm starting with new thing.
Thank you very much 8)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group