PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 11:37 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Sep 12, 2011 8:43 am 
Offline

Joined: Mon Sep 12, 2011 8:19 am
Posts: 2
Hi

I have created a method for creating PDF files out of tiff files.
the method works perfectly on Windows Server 2003 and 2008 std. also x86 and x64.
The I tried running the application on a Windows Server 2008 x64 R2 and suddenly the PDF file only contained the first page of the multitiff file.

scenario is: 10 page multitiff file converted into a 10 page PDF file.
but when running the application on Windows Server 2008 R2 x64 the same first page on the multitiff file was on all 10 pages of the PDF file... why?

my code:

Dim oImg As System.Drawing.Image = Nothing
oImg = New Bitmap(oInputMemStream)

...

For _imgPageCount = 1 To _imgPageCountTotal

oImg.SelectActiveFrame(oImgFrameDimension, _imgPageCount - 1)
Dim newImg As System.Drawing.Image = oImg

'Testing to see if the correct page has been choosen and everthing so far works fine
newImg.Save("D:\" & _imgPageCount & ".tif", System.Drawing.Imaging.ImageFormat.Tiff)

oPDFPage = New PdfPage
oPDFPage.Size = PageSize.A4
oPDFPage.Orientation = PageOrientation.Portrait
oPDFDoc.Pages.Add(oPDFPage)

'adding the image/bitmap to the PDF ximage
oPDFImg = XImage.FromGdiPlusImage(newImg)
oPDFGraphic = XGraphics.FromPdfPage(oPDFPage)
oPDFGraphic.DrawImage(oPDFImg, 0, 0, CType(oPDFImg.PointWidth, Integer), CType(oPDFImg.PointHeight, Integer))

next

...

oPDFDoc.Save(oPDFMemStream, False)


any one has an idea why this is working on some system and not on others???

Br, Sebastian Johannsson


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 15, 2011 9:42 am 
Offline

Joined: Mon Sep 12, 2011 8:19 am
Posts: 2
Found the solution....

PDFSharp /ximage was not the problem, but instead the .NET FrameDimensions when creating Multitiff files.
apparently Windows 2008 x64, 2003 etc does not have any issues if the frameDimension is not correct set.
windows server 2008 x64 R2 has an issued with that and after correcting this everything works perfectly again :D

Br, Sebastian


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

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 41 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