Printing in IE6 completely different to other A-grade browser printing - printing

Does anyone know of a best practice print document for printing a website in IE6? I have a specific page that needs to be printed and it comes out well in other browsers except IE6 where it is being chopped off by a huge amount on the right side of my page.
Thanks

I have found the most fool-proof method of making something printable is by providing a print button that links to a PDF version of the document.
Generating the PDF is the major task there but that can be quite simple with the right tool.
I use http://www.xhtml2pdf.com/ which is a Python app to take a page and generate a PDF version. It might need some tweaking so you might need a special stylesheet to fix some things.
Other than that, you're left fixing IE. It might help to add a print stylesheet:
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
And overriding some of your more extravagant positioning methods. If you're centring, pull it back to the left, cut out extraneous margins and padding (remember background-images won't render with standard print settings so you can cut out a lot of padding).
You might find there's some crossover (ie you use some of the print styles in your PDF version) so you might be able to generate a hybrid solution to allow people to grab PDF versions and print straight from HTML.

Related

How to stop automatic download on IE 11 while using iframe

I have given a source in a Iframe tag, my is issue is that when the page loads on IE the download begins automatically and it generally happens on IE installed on windows 8.
<div> <iframe src="../../Images/Sample.pdf" width="800px" height="800px" ></iframe> </div>
It's downloaded probably because there is not Adobe Reader plug-in
installed. In this case IE (it doesn't matter which version) doesn't
know how to render it and it'll simply download file (Chrome, for
example, has its own embedded PDF renderer).
That said. is not best way to display a PDF (do not forget
compatibility with mobile browsers, for example Safari). Some browsers
will always open that file inside an external application (or in
another browser window). Best and most compatible way I found is a
little bit tricky but works on all browsers I tried (even pretty
outdated):
Keep your but do not display a PDF inside it, it'll be filled
with an HTML page that consists of an tag. Create an HTML
wrapping page for your PDF, it should look like this:
<html>
<body>
<object data="your_url_to_pdf" type="application/pdf">
<embed src="your_url_to_pdf" type="application/pdf" />
</object>
</body>
</html>
Of course you still need the appropriate plug-in installed in the
browser. Also take a look to this post if you need to support Safari
on mobile devices.
1st. Why nesting inside ? You'll find answer here on
SO. Instead of nested tag you may even provide a custom
message for your users (or a built-in viewer, see next paragraph).
2nd. Why an HTML page? So you can provide a fallback if PDF viewer
isn't supported. Internal viewer, plain HTML error messages/options
and so on...
It's tricky to check PDF support so you may provide an alternate
viewer for your customers, take a look to PDF.JS project, it's pretty
good but rendering quality - for desktop browsers - isn't as good as a
native PDF renderer (I didn't see any difference in mobile browsers
because of screen size, I suppose).
See also: HTML embedded PDF iframe

Firefox Demands Absolute URL For Referencing Stylesheet

I just spend the last few hours debugging a huge problem, the problem being,
My external css style sheet were not loading when I used Firefox.
Using Firefoxes debugging tools I was able to conclude that the file was not been found, it had nothing to do with the MIME type or encoding as I checked.
I was using relative URL's to reference my style sheets to I decided to use absolute and it worked! after hours of nearly losing my mind.
However using absolute URL's on every page is just a pain and not practical if I am debugging on localhost all the time.
Could anyone tell me why I need to proved the absolute URL's? The CSS file is there and Firefox states the relative URL and when I go to it manually, it works, however Firefox will just not find it. Every other browser including Chrome and Safari Works with the relative URL's.
I could use php and define all these relative URL's and then reference these within my HTML making it easier to switch domains for debugging but still its a pain and I don't know why I have to do this.
My site here
Thanks in advance,
Jack.
Note : For testing reasons I am giving the link to my site which I am having problems with, nothing to do with advertising.
For your stylesheet problem: change the backslash to a forward slash in your <link> element.
<link rel="stylesheet" href="css/main.css">
There are a couple of images with a similar problem.
You have a number of other errors: <script> tags between <head> and <body>, and some loose </article> tags as well
If you're using Firefox, take a look at the page source and fix anything you see highlighted in red. Then try again.

IE9 and TEXTAREA newlines

We display a piece of signed XML in a TEXTAREA. The signing takes into account the whitespace, so it is critical that this is maintained.
The user then copies and pastes this into an application that validates the XML... we've not had a problem with this until now... IE9 is rending the text slightly differently.
When I copy it into a HEX editor, I can see that IE9 is rendering newlines as 0xA... put it into compatibility mode (or use IE6,7,8, Chrome, Firefox etc.) and it gets rendered as 0xD,0xA
I guess this won't effect most people, as it looks ok... but for us it is a royal PITA!!!
Anyone come across this, and better have a fix :)
Thanks!!!
Not sure if this is really a fix (and I do wonder if this is a bug in IE9?)
Anyhow, I ended up putting IE9 into IE7 emulation mode for the page in question:
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
It works, but now, of course I don't have the IE9 features on this page.

IE Chinese characters

I am currently working on a site which has some pages displaying Chinese characters. These display fine on Firefox however on IE I receive a simple box where the character should be.
I thought this was simply because I did not have the language pack installed onto Windows, but then I was provided some samples of it working.
Can someone please explain why this page displays properly for me in IE
http://www.ifc.org/chinese
But this does not?:
http://www.jjl.cn/
(Google.cn does not display correctly either)
I have tried
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
But have had no luck.
Thanks
It has nothing to do with the encoding, both sites work fine on my browser. It is because you do not have the proper language fonts installed on your computer.
I typically install these fonts upon install, so don't recall that exact installation process. But you can likely find out how by going to Control Panel -> Regional and Language Options. If you still can't figure it out check out this wiki link.
http://en.wikipedia.org/wiki/Help:Multilingual_support_(East_Asian)
note Keep in mind that input methods(used for typing the languages) are different than character fonts(used for displaying the languages).
note 2I typically use UTF-8 as the charset for all my pages, especially if I know I will be dealing with multilingual content.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Here is how I tell what my problem is when dealing with characters not displaying correctly:
If you see a bunch of squares, it is your computer, and you need to install the appropriate font files.
If you see a bunch of random ASCII characters, then it is likely that the page encoding is incorrect. In which you can change which encoding to render the page in via browser settings as a temp fix
Very Unlikely Somebody is playing a mean joke and wrote a page using random ASCII characters/squares just to annoy users. :)

Firefox Extension - Need a specific div to ignore xhtml errors (mismatched tag, etc)

My firefox extension loads content from a 3rd party site into an overlay panel. This content is user generated and sometimes will, for instance, have an image tag that does not close which causes a mismatched tag error to be thrown and the extension fails. Is there any way I can sandbox this content so that these kind of errors are not an issue? I was thinking maybe load the content into a blank iframed page.. but was wondering if there might be a cleaner solution.
Unfortunately, unless you're getting back XML, there is no XPCOM solution for parsing. Your best bet is what you suggested - placing the content in an iframe.
You can find some more discussion about the topic at: http://www.mozdev.org/pipermail/greasemonkey/2005-April/001255.html
Your guess about an iframe was correct, there's no better way to do it (as of Firefox 3.5): Parsing HTML From Chrome on MDC

Resources