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!
![]() |
quickPDF render to Device Context |
Post Reply
|
| Author | |
munteanu24d
Beginner
Joined: 03 Sep 09 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: quickPDF render to Device ContextPosted: 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 |
|
![]() |
|
deabrew
Newbie
Joined: 19 Jan 09 Status: Offline Points: 43 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
munteanu24d
Beginner
Joined: 03 Sep 09 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
munteanu24d
Beginner
Joined: 03 Sep 09 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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> |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store