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 - Rendering to DC in virtual PC environment
  FAQ FAQ  Forum Search   Register Register  Login Login

Rendering to DC in virtual PC environment

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


Joined: 27 Jul 18
Location: UK
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewH Quote  Post ReplyReply Direct Link To This Post Topic: Rendering to DC in virtual PC environment
    Posted: 27 Jul 18 at 10:36AM
Using DebenuPDFLibraryDLL1411 with C++

We are print previewing the PDF and hence rendering the PDF to DC by calling:

DebenuPDFLibraryRenderPageToDC(int, double, int, HDC);

this works fine when running on your own PC using the graphics drivers on the PC.  However, when running our software in a virtual environment the image quality of the PDF is not anywhere near as clear and crisp.  Is there anything we can set call in the Debenu PDF Library that can resolve this?
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jul 18 at 12:17PM
What are you using to view the screen of the VM for the preview?  Remote Desktop?  VNC? Teamviewer?  Something else?  Is this remote software scaling the image, and have you experimented with adjusting this?  You could also try rendering to a PNG file with appropriate scaling and resolution and displaying that instead.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jul 18 at 8:56PM
Hi Andrew,

welcome here in the forum.
Perhaps the described behavior has to do with the settings of the vm?
The virtuell graphic memory could be too small.
Are the same dlls in the vm-system as in the real pc?
 
Cheers,
Ingo

Back to Top
AndrewH View Drop Down
Beginner
Beginner


Joined: 27 Jul 18
Location: UK
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewH Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jul 18 at 8:47AM
Thanks for the replies, spoken to our systems admin and he says that it's not down to the VM's but RDP/Citrix.  If he RDP's to another PC they get the same problem!  He is adamant the problem is located in the print preview code.  

int quickPDF::RenderPageToDC(int pageNum, HDC hDC, double DPI)
{
int ret(0);

if (LibraryOK())
{
if (m_pDPL->SelectPage(pageNum))
{
m_pDPL->SetRenderDCErasePage(0);
ret = m_pDPL->RenderPageToDC(DPI, pageNum, hDC);
}
}

return (ret);
}

int DebenuPDFLibraryDLL1411::SelectPage(int PageNumber)
{
return DebenuPDFLibrarySelectPage(instanceID, PageNumber);
}

int DebenuPDFLibraryDLL1411::SetRenderDCErasePage(int NewErasePage)
{
return DebenuPDFLibrarySetRenderDCErasePage(instanceID, NewErasePage);
}

int DebenuPDFLibraryDLL1411::RenderPageToDC(double DPI, int Page, HDC DC)
{
return DebenuPDFLibraryRenderPageToDC(instanceID, DPI, Page, DC);
}
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jul 18 at 11:11AM
What are you putting into DPI?  And does it match the VM's virtual DPI?  And does the virtual DPI change depending on how you log in to the VM? And how do you create the device context?  Have you used SetRenderScale?  The code you show is very unlikely to be the source of the problem. We render PDF to an image, as I said, and then display the image, making it as crisp and clear when viewed in a VM over RDP as it is when running and displaying on the local screen.  You should be able to mismatch the settings deliberately on your local machine and reproduce the problem there to prove that this is the cause.

However it occurs to me that since you are using C++, you may be limited to creating and using a device context when you come to displaying an image file anyway, so my suggestion would not help.  The advantage of Delphi is that the VCL and third party libraries give you complete control over image scaling and rendering.  If you use raw Windows device contexts you are subject to all sorts of influences which need to be taken into account and which may not be under your control.
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jul 18 at 11:15AM
One other issue: is the OS the same in the VM as on the local machine and are the OS scaling settings the same?  Recent versions of Windows treat scaling differently and may require adjustments to your application manifest.
Back to Top
AndrewH View Drop Down
Beginner
Beginner


Joined: 27 Jul 18
Location: UK
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewH Quote  Post ReplyReply Direct Link To This Post Posted: 30 Jul 18 at 11:21AM
Creating a Print Preview DC, and yes we are calling SetRenderScale
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