PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 5:15 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Apr 22, 2010 10:40 am 
Offline

Joined: Thu Apr 22, 2010 10:25 am
Posts: 14
For some reason, my code is working perfectly in my dev environment, but when uploading to live server - I got no error, just a "request timed out".

Local dev is server 2008 IIS7 - live server is 2003 IIS6


Code:
    Dim filename As String = "c:\pdfTest\blank.pdf"

        Dim document As PdfDocument = PdfReader.Open(filename)
        document.Options.ColorMode = PdfColorMode.Cmyk

        document.Info.Title = "Created with PDFsharp"

        Dim page As PdfPage = document.Pages(0)
        Dim gfx As XGraphics = XGraphics.FromPdfPage(page)
        Dim Image As XImage = XImage.FromFile("c:\pdfTest\test.jpg")

        gfx.DrawImage(Image, 100, 100, 200, 200)

        document.Save("c:\pdfTest\output.pdf")



If I comment out the gfx.DrawImage(Image, 100, 100, 200, 2) then it opens the pdf and resaves it fine, so I know the problem is with the drawImage. The problem is, because no error is being returned, I dont know where to fix.

Please can someone help, as I need to get this live before the end of the week.

Many thanks in advance.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 22, 2010 11:28 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
I hope you use a RELEASE build on your live server. Try a RELEASE build if you use a DEBUG build.

It could be a problem with user rights. You can set the Application Pool to use "Local System" if it's still using the default setting of "Network Service".

GDI+ build? WPF build?
Anyway: trying the other build could be worth a try.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 22, 2010 12:48 pm 
Offline

Joined: Thu Apr 22, 2010 10:25 am
Posts: 14
Thank you for your prompt response.

The build is RELEASE. I have tried changing the App Pool to Local System, and this still didnt work.

It is using the WPF build - I'm not sure how I can change this to GDI+?

Regards


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 22, 2010 1:07 pm 
Offline

Joined: Thu Apr 22, 2010 10:25 am
Posts: 14
Thank you for your help - I have moved to the GDI build and it works.

Are there any drawbacks to using GDI instead of WPF?

Kind regards


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

All times are UTC


Who is online

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