Our site has PDF's embedded into our pages which allow the user to print them. We have this working across all browsers/platforms using various techniques PDFjs/PDFObject/iframes etc...
However when it comes to the Edge none of these techniques print properly. Using the an iframe which I assume is using the native PDF viewer there is no print option (only Save As), If I print using the Edge toolbar I get all the html content around it (I appreciate that I could hide the rest of the content using css for the print, but I was hoping there would be a cleaner way). Using PDFjs prints the whole page not just the PDF. PDF Object just tells me I don't have Adobe Installed preumably because there is no ActiveX support.
So my questions are has anyone else worked out how to print out an embedded PDF in Edge yet? And if you have how?
Microsoft are aware of this issue in Edge, and are looking to introduce it in the upcoming Windows 10 Creators Update (Version 1703, AKA Redstone 2 or RS2), scheduled for Spring 2017.
As far as I can tell there is no current solution to this problem.
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7801755/
Related
Why Google Viewer sometimes is opening a blank page instead of open the PDF file?
I could simulate it using this code. It doesn't happen every time. It will be necessary to click on the Google Viewer button few times.
I could simulate it on Edge and Chrome.
Pay attention to the two tabs after the tab title "Sem títlulo". They opened the PDF file perfectly. However, the tab with the title "Sem título" did not open the PDF.
EDIT
I'm using google docs viewer https://docs.google.com/viewer.
I try to test your code on the MS Edge legacy browser, MS Edge (Chromium) browser, Google Chrome browser, and Firefox browser.
I can reproduce the issue on all 4 browsers. So we can say that this is not a specific browser related issue.
I noticed that you are using Google docs viewer to display the PDF.
https://docs.google.com/viewer?
I try to display the PDF directly in the browser and found that it is working fine in every browser.
Test code:
Click to open PDF
Here is the test results in MS Edge (Chromium) browser.
So it looks like there is some issue with the Google docs viewer. You can try to provide feedback to Google about this issue.
To fix the issue in your code, you can try to directly display the PDF file as I show you in my sample code. You can notice that performance is also better.
PDF that contains javascript runs this code when embedded in html and displayed in Chrome. This is better described in this closed issue https://bugs.chromium.org/p/chromium/issues/detail?id=511295
Is there any way how to disable the javascript support alltogether? Sadly i wan't even able to find what exactly is supported in chrome pdf viewer, only that this shouldn't lead to XSS. Still, randomly popping alerts are annoying even without immediate security threat.
I'm trying to generate a pptx file with charts but there is an error while opening the generated file in Power Point when there is some 'chart.LINE'. Charts with '.BAR' type are rendered normally, like texts and images.
The same file opens perfectly in Keynote and in Libre Office. That's just in Power Point, and it occurs in any version (I'm using Microsoft Office 2016).
I am working with latest version of PptxGenJS (v2.1.0) and nothing goes wrong during export. I mean that the code runs normally, without erros or warnings and the file is exported. The problem occurs while trying to open.
The error messages in Power Point are:
PowerPoint could not read content and removed it / Power Point may try to repair the presentation / Power Point failed to repair content and removed it
Basically a default message informing that was not possible to read some content and by trying to repair, it has been removed.
Note: By opening the file in Keynote or Google Slides and then saving/exporting as ‘pptx' it works. All charts are rendered normally.
Expected result - Only occurs in Keynote or Google Slides
I don’t know what’s going on due to the lack of explicit errors and if someone could help me I would appreciate.
Thank you.
Is the PowerPoint version you are using 32 bit?
Maybe the framework is exporting 64-bit components, and your PowerPoint is 32.
That would explain the error message at the beginning.
That's basically it. Somehow, the javascript in Google Docs can turn off the default headers and footers showing the URL, date, page numbering, etc.
This only works in Google Chrome. When Google Docs is running from another browser it will print the headers/footers unless removed manually through the print configuration dialog. In Safari, it seems to generate a PDF server-side which of course will print outside of the browser.
I've searched around the web and have found nothing on how this is done. The javascript in the page is of course minified and obfuscated so it's difficult to get any insights from there.
So before I'm forced to dive into that spaghetti, I'd like to know if anybody has any ideas of how this is done.
After delving into some source code I found on a web page that has also resolved the issue (not Google Docs), the secret is the following CSS:
#page
{
margin:0;
}
This only works on Chrome, and perhaps Opera though I have to verify if the latter is true as it's printing the background color by default while chrome prints with a white background and the colored background in my page might be just obscuring the header/footer text.
Other browsers give differing results:
Firefox and Safari ignore the margins apparently and print the headers/footers anyway.
IE9 makes a mess of things and the contents print overlapped with the header/footer text. Poor browser always gets all the heat...
In conclusion, combining this with silent printing coming out in Chrome 18 kiosk mode will make for some interesting functionality, such as mail merge capabilities right from the browser though I still have to research how secure kiosk mode is though, as navigating to a malicious page runs the risk of exhausting printer ink and paper.
Navigation should be restricted to a URL white-list in this case.
I am trying to make a web page which allows users to drag and drop images into Microsoft Office applications, specifically Powerpoint.
By default (as of FF3.5), Firefox will insert the source URL when an image is dropped rather than the image itself. After adding the following Javascript/jQuery code (derived from https://developer.mozilla.org/En/DragDrop/Drag_Operations),
$('img').attr('draggable', true).bind('dragstart', function (event) {
event.originalEvent.dataTransfer.effectAllowed = 'copy';
});
dragging and dropping works from Firefox to Word and Excel, but not to PowerPoint. For an example of what happens, see http://slides.html5rocks.com/#drag-and-drop. I have tested this with FF3.6 and FF9.
How can I make it work with PowerPoint?
Just drag'n'drop outside the boundaries of the ppt slide (to make sure you're not dropping on a predefined textbox) - and release the mouse button -no coding needed!
Firefox drag will drop the image at the center of te ppt slide.
Status quo
Sadly there is nothing you can do from within your browser and the application to enable drop support for PowerPoint.
This is something that needs to supported at source level in PowerPoint (and it seem to be if you don't drop the image on an existing element but right outside the slide frame you want to drop it onto - but probably depending on version).
If it (for some reason still) does not support the image part of the drop but just the link (and if there is no option provided for changing this behavior) there is little to do but to hope Microsoft will update PowerPoint with this support in the future, - or - check the following options for work-arounds if needed:
Add-ins
You can look into writing an add-in (or possibly just use a macro - you might need to lower security to medium [PDF] for macros) for PowerPoint that will take the link that is dropped and replace it with the image the link refers to.
Here is one place to get you started making add-ins if this is a viable option.
Here is a commercial framework that makes creating add-ins very simple.
(disclaimer in this regard: I am here assuming this will be possible due to add-ins such as this which allow you to show a live web page inside PP).
Pipe-line / work process
There is also the option of injecting a third-party applications in the pipe-line to do screen snapshots of the image and have it inserted automatically into PP.
SnagIt is such an application (and there are probably others) and it has free extensions that will allow you to integrate "snags" directly with PowerPoint.
Or (the perhaps too obvious option): simply copy the image in browser and paste it into PowerPoint.
What is your version of Powerpoint?
It's very important because image format support may be lacking.
If that's the case your code needs a minimum version warning addition.
Could also ask to convert image to suitable format.
It may even be the case that it's impossible to the version of Powerpoint you're using to support this in the way you want.
You could try to use html code.
This code might help you:
http://classroomtech.org.uk/2008/08/drag-and-drop-in-powerpoint/
Other possibilities are OLE object with a link to a image.
Could check how other Microsoft applications, that do something similar, handle things.
If that doesn't work you could try to generate an OLE object with a link to the image in it.