Loading...

ImageHeight returning wrong results

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

ImageHeight returning wrong results

Postby JNewhouse » Wed Jan 28, 2009 6:45 am

Hello Loic,

I was updating my application with the latest gdpicture control 5.10.0 and found a problem with the ImageHeight and ImageWidth properties of the viewer control (this was working correctly prior to my installing this update).

I have a multipage pdf file, before printing i check the size to determine which paper tray to use. the first page reads the ImageHeight and ImageWidth correctly, however all remaining pages return the wrong results for these properties - it's a legal size document but it's showing 13 for the width and 22 for the height when it should be 935 x 1540.

Once again, the properties on the first page of the pdf read 935 x 1540, the remaining pages read 13 x 22. I verfied that the pdf file displays correctly in Adobe Reader, nothing unusual about it. i'm using VFP9.0

After a bit of troubleshooting I found that the PrintImage() function is what's messing things up. if i comment this line out, it reads each page correctly. If I add the line back in, the ImageHeight and ImageWidth return incorrect values.

here is a sample of the code i'm using.


Code: Select all
 
  lcPrinter = SET("printer",2)

  o = CREATEOBJECT("gdPicturePro5.GdViewer") 
  o.SetLicenseNumber(GD_LICENSE)
 
  lnReturn = o.PrintSetActivePrinter(lcPrinter)
  ** make sure it doesn't autorotate
  o.PrintSetAutoRotation(.F.)
   
  o.PdfDPIRendering  = 110
  o.PdfRenderingMode = 2

  lcImageFile = "c:\pdf_test\print_test.pdf"
  lnReturn = o.DisplayFromPdfFile(lcImageFile)

  lnPgCount = o.PageCount
  FOR i = 1 TO lnPgCount
    lnReturn = o.Displayframe(i)
    lnHeight = o.ImageHeight
    lnWidth  = o.ImageWidth
    lnPaperTray = 5
    lnReturn = o.PrintSetStdPaperSize(lnPaperTray)

    o.PrintSetOrientation(1)                                   

    o.PrintSetFromToPage(i, i)

    o.PrintImage()  && comment this line out and it returns the correct height and width

  ENDFOR
  o.CloseImage
JNewhouse
 
Posts: 41
Joined: Thu Nov 15, 2007 9:37 pm

Re: ImageHeight returning wrong results

Postby Loïc » Thu Jan 29, 2009 6:17 pm

Hi,

I fixed this problem.
Please wait for the next release to get this modification (within max 7 days).

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: Google [Bot] and 1 guest