Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - quickPDF render to Device Context
  FAQ FAQ  Forum Search   Register Register  Login Login

quickPDF render to Device Context

 Post Reply Post Reply
Author
Message
munteanu24d View Drop Down
Beginner
Beginner


Joined: 03 Sep 09
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote munteanu24d Quote  Post ReplyReply Direct Link To This Post Topic: quickPDF render to Device Context
    Posted: 03 Sep 09 at 3:51PM
Hello everybody!

I want to use quickPDF as a viewer in my C++ application, and moreover I need to render to the pdf content to a DC.
I had a look to windows MFC classes, but I do not know exactly which type of DC is supported.

Can somebody give me more details about how to render the PDF to a DC, or point me to some tutorials?

Thanks in advance,|
D.M.

Edited by munteanu24d - 03 Sep 09 at 3:56PM
Back to Top
deabrew View Drop Down
Newbie
Newbie
Avatar

Joined: 19 Jan 09
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote deabrew Quote  Post ReplyReply Direct Link To This Post Posted: 03 Sep 09 at 4:02PM
Hi D.M.

Try something like this ... 
________________

BOOL CPDFViewerDlg::OnInitDialog()
{

// Draw updated page
m_iDAFileHandle = m_QP.DAOpenFile(m_strFile, CString(_T("")));
m_iPageRef = m_QP.DAFindPage(m_iDAFileHandle, 1);
// Resize window based on new PDF
MoveWindow(0, 0, m_QP.DAGetPageWidth(m_iDAFileHandle, m_iPageRef), 
m_QP.DAGetPageHeight(m_iDAFileHandle, m_iPageRef),TRUE);
// Set the dialog title
CString strTitle;
::GetFileTitle(m_strFile, strTitle.GetBufferSetLength(1024), 1024);
strTitle.ReleaseBuffer();

// Recenter the dialog in the center of the active window
CenterWindow(GetDesktopWindow());

return TRUE;  // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

void CPDFViewerDlg::OnPaint()
{
CPaintDC dc(this);
m_QP.DARenderPageToDC(m_iDAFileHandle, m_iPageRef, 72,(int) (HDC) dc);
}

________________


Edited by deabrew - 03 Sep 09 at 4:07PM
Back to Top
munteanu24d View Drop Down
Beginner
Beginner


Joined: 03 Sep 09
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote munteanu24d Quote  Post ReplyReply Direct Link To This Post Posted: 03 Sep 09 at 4:56PM
Thank you so much !
It really worked!

I would like to move from MFC to GTK . Is it possible to render it in a GTK DC too?

Best wishes,
D.M.



Edited by munteanu24d - 03 Sep 09 at 4:56PM
Back to Top
munteanu24d View Drop Down
Beginner
Beginner


Joined: 03 Sep 09
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote munteanu24d Quote  Post ReplyReply Direct Link To This Post Posted: 04 Sep 09 at 5:59PM
Just in case somebody will need the answer of my question ... here it is:

Yes, quickPDF can be used to render even to GTK device content.

<code>

HWND m_hwnd = HWND(GDK_WINDOW_HWND(this->m_drawingArea.get_window()>gobj() ));
HDC m_hdc = GetDC(m_hwnd);   
QP.RenderPageToDC(100, 1,(int)(HDC) m_hdc);

</code>
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store