-
Jan 16th, 2021, 04:32 PM
#1
Thread Starter
New Member
Webbrowser control in Winforms, showing .pdf - sort of
I programmatically create a Webbrowser control in a form to show the contents of a pdf file - it works, but one thing is strange - the pdf appears in the upper-left-hand corner of the Webbrowser, using half the height and half the width of the control (it shows up with scrollbars, so it's still readable).
In the attached image, the white area is the webbrowser control (the form background is dark gray, I didn't include much of that).
The fact that it's using exactly half of the height and half of the width seems to be a clue, but I can see no property or setting that would affect this. Does anyone have any ideas?
-
Jan 16th, 2021, 10:29 PM
#2
Re: Webbrowser control in Winforms, showing .pdf - sort of
What happens if you add the control in the designer? These are the sorts of things you should be testing, to narrow down the specifics of the issue. If it works for one and not the other then you can compare the two controls and see what might be different between them.
-
Jan 17th, 2021, 04:32 AM
#3
Thread Starter
New Member
Re: Webbrowser control in Winforms, showing .pdf - sort of
 Originally Posted by jmcilhinney
What happens if you add the control in the designer? These are the sorts of things you should be testing, to narrow down the specifics of the issue. If it works for one and not the other then you can compare the two controls and see what might be different between them.
I tried that, as a standalone test on a different form in the same project, and got the same result. The Webbrowser control shows .html fine, using the full control real estate, but for .pdf's it's still the upper-left-hand corner. I'll try an entirely new solution/project just to verify it's not something hiding in the overall environment.
-
Jan 17th, 2021, 05:38 AM
#4
Re: Webbrowser control in Winforms, showing .pdf - sort of
in the web browser control, do you have 2 controls to manage both HTML and PDF, one for the HTML and one for the PDF?
edit : after a bit of research, it seems that the web-browser control doesn't open directly the PDF but use an ActiveX control from Adobe or from other PDF viewer. The problem may come from that.
Last edited by Delaney; Jan 17th, 2021 at 05:43 AM.
The best friend of any programmer is a search engine 
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|