PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jul 09, 2024 10:21 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jun 03, 2011 8:28 am 
Offline

Joined: Fri Jun 03, 2011 8:18 am
Posts: 2
Hi all!!!
I'm having problems when trying to add an image to an existing PDF file. It appears the next error:

"Object type transformation must not be done with direct objects"

Here is my piece of code:

Code:
Dim documento As PdfDocument = PdfSharp.Pdf.IO.PdfReader.Open("path\file_name.pdf")

 If documento.Version <= 14 Then
       documento.Version = 14
 End If

 Dim pagina As PdfPage = documento.Pages(0)
 Dim gfx As XGraphics = XGraphics.FromPdfPage(pagina)
 Dim imagen As XImage = XImage.FromFile(System.AppDomain.CurrentDomain.BaseDirectory & "qr.jpg")

 gfx.DrawImage(imagen, 470, 720)

 documento.Save("new_path\new_file_name.pdf")


I have launched a Release version of the program but that error message still appears ... what am I doing wrong???

Thanks on advance!!!!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2011 7:13 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Pee-Wee wrote:
I have launched a Release version of the program but that error message still appears ... what am I doing wrong???

Use a release version of the PDFsharp DLLs.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 07, 2011 6:12 am 
Offline

Joined: Fri Jun 03, 2011 8:18 am
Posts: 2
Thanks a lot, that was the point!!!!!!!

Thanks again!!!!! :D


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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