Foxit Corporation Forums  

Go Back   Foxit Corporation Forums > Portable Document Format (PDF) Tools > SDK ( DLL or ActiveX)

SDK ( DLL or ActiveX) Integrate PDF functions into your application easily. The SDK shares the same technology that powers Foxit Reader.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 3rd, 2006, 01:35 AM
delbeke delbeke is offline
Junior Member
 
Join Date: Jul 2006
Location: FRANCE
Posts: 3
delbeke is an unknown quantity at this point
Default Printing problems

Hi

I have problems using the FPDF_RenderPage function with some printers

On the first printer (Lexmark X215) all works perfectly. the second one (LexMark C752) the text is correctly printed but graphics elements are printed with a more higher resolution (a fisrt sight, 6x more accurate)

He is a portion of my vb5 code
Quote:
If cmnDlg.ShowPrinter Then
frmImpr.Show 0, Me 'show printing form
Printer.Copies = cmnDlg.Copies
If Printer.Copies = cmnDlg.Copies Then
NbCopies = 1
Else
'the driver do'nt hangle multi-copies
NbCopies = cmnDlg.Copies
End If
'look for first page's orient
mvarFPDFVIEWERhPdfDoc = FPDF_LoadDocument(mvarPdfFileName, "")
hPdfPage = FPDF_LoadPage(mvarFPDFVIEWERhPdfDoc, cmnDlg.FromPage - 1)
PdfPageWidth = ScaleX(FPDF_GetPageWidth(hPdfPage), vbPoints, vbPixels)
PdfPageHeight = ScaleY(FPDF_GetPageHeight(hPdfPage), vbPoints, vbPixels)
FPDF_ClosePage hPdfPage
If PdfPageWidth > PdfPageHeight Then
PrnOrient = 2
Else
PrnOrient = 1
End If
Printer.Orientation = PrnOrient
Printer.ScaleMode = vbPixels
Printer.Print " " 'to got a clean hdc
dc = Printer.hDc
'read printer's offsets/margins
PrnOffsetX = GetDeviceCaps(dc, PHYSICALOFFSETX)
PrnOffsetY = GetDeviceCaps(dc, PHYSICALOFFSETY)
PrnWidth = GetDeviceCaps(dc, HORZRES)
PrnHeight = GetDeviceCaps(dc, VERTRES)
For iPnt = 1 To NbCopies 'for each copy
For lPnt = cmnDlg.FromPage To cmnDlg.ToPage 'for each selected page
frmImpr.lblPage = "Page : " & CStr(lPnt): DoEvents
hPdfPage = FPDF_LoadPage(mvarFPDFVIEWERhPdfDoc, lPnt - 1)
If hPdfPage = 0 Then
MsgBox "Erreur rendering page n° " & CStr(lPnt)
Else
'control for orient change
PdfPageWidth = ScaleX(FPDF_GetPageWidth(hPdfPage), vbPoints, vbPixels)
PdfPageHeight = ScaleY(FPDF_GetPageHeight(hPdfPage), vbPoints, vbPixels)
If PdfPageWidth > PdfPageHeight Then
TestPrnOrient = 2
Else
TestPrnOrient = 1
End If
If lPnt > cmnDlg.FromPage Then
'if not the fisrt page
If TestPrnOrient = PrnOrient Then
'same orient
Printer.NewPage
Else
'orient changed => end the doc and start a new one
Printer.EndDoc
PrnOrient = TestPrnOrient
Printer.Orientation = PrnOrient
Printer.ScaleMode = vbPixels
Printer.Print " " 'got a clean hdc
dc = Printer.hDc
'read printer's offsets/margins
PrnOffsetX = GetDeviceCaps(dc, PHYSICALOFFSETX)
PrnOffsetY = GetDeviceCaps(dc, PHYSICALOFFSETY)
PrnWidth = GetDeviceCaps(dc, HORZRES)
PrnHeight = GetDeviceCaps(dc, VERTRES)
End If
End If
'render the page
FPDF_RenderPage dc, hPdfPage, PrnOffsetX + 100, PrnOffsetY + 100, PrnWidth - PrnOffsetX - 200, PrnHeight - PrnOffsetY - 200, Rot, 0
'close the page
FPDF_ClosePage hPdfPage
End If
If frmImpr.Canceled Then
'if canceled , do'nt draw others pages
Exit For
End If
Next
Printer.EndDoc
Next
'close the document
FPDF_CloseDocument mvarFPDFVIEWERhPdfDoc
End If
'===================
All work fine on the display and the pdf is rendered corectly

Note : i've not succed aataching a sample
I've sent you an email with samples to Support@foxitsoftware.com



Best regars
Reply With Quote
  #2  
Old July 5th, 2006, 02:14 AM
william's Avatar
william william is offline
Foxit Developer
 
Join Date: Dec 2005
Posts: 192
william is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of lightwilliam is a glorious beacon of light
Default hi delbeke

hi delbeke,

It seems to be an old bug and doesn't exist in the new version of sdk.
We have already compile a new version and sent it to your email address.
Please check it out and let us know if the problem persists.
Reply With Quote
  #3  
Old July 7th, 2006, 12:09 AM
delbeke delbeke is offline
Junior Member
 
Join Date: Jul 2006
Location: FRANCE
Posts: 3
delbeke is an unknown quantity at this point
Default

Thanks you very much
I'll try it right now.

Bets regards
Reply With Quote
  #4  
Old July 7th, 2006, 02:41 AM
delbeke delbeke is offline
Junior Member
 
Join Date: Jul 2006
Location: FRANCE
Posts: 3
delbeke is an unknown quantity at this point
Default

Well done, every thing is perfect, now

Thanks very much
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2005-2008 Foxit Corporation. All rights reserved.