I have a pdf uploaded in a html dom.
I have the pdf and the coordinates (x,y) of a text/line/paragraph from the pdf.
I want to navigate to the exact location of that text/line in the pdf using the coordinates as input parameters and highlight the area enclosed by the coordinates.
Is it acheivable using pdf.js ?
Generally those methods within browsers are highly variable based on system and version so take for example attempting to scroll to the zzzzz line
this works in Chromium/Edge:-
https://africau.edu/images/default/sample.pdf#page=1&view=fitH&zoom=0,0,225
For Firefox PDF.js to get to a similar place you need
https://africau.edu/images/default/sample.pdf#page=1&zoom=FitH,625
For a word search Firefox works but modern chrome or chrome with acrobat appears not to work also see https://stackoverflow.com/a/73299830/10802527
Related
I am interested in messing with the built-in PDF viewer of Microsoft Edge. I know you can inspect its files in the Dev console, but I would like to know where these files are actually located so I can change them to alter/add some functionality.
Another possibility would be to run a user script when a PDF is loaded, but tampermonkey does not seem to work when a PDF file is opened in Edge.
Why I want to do this: I would like to see whether I can implement additional functions that I'd like to use in the PDF viewer. I know there are pdf js libraries out there, but I feel like none of them display pdfs as nicely as Edge does and I haven't found one that allows drawing on pdfs.
You can see the edge_pdf source code by inspect the page ,then click the Source panel, it show all the resource which edge_pdf loaded.
I have a JavaScript/jQuery application that dynamically creates a catalog of my film collection, based upon a JSON file. For example, if you click the Titles button, the space below the button fills with all titles in the collection. Each title line also includes a link that uses the serial number as link context, providing a small body of film information that appears within a new window (=popup). All browsers (IE11, Edge, Firefox, Chrome) behave similarly to this point.
IE11 and Edge also show a JPEG image at the bottom of that film data, where that image is a link to another JavaScript application on my server that shows the JPEG image (up to) full screen.
Chrome does not acknowledge the JPEG image at all. Firefox shows an outline of the image but does not show the image nor acknowledge the link that it is to the other JS application.
I have gone through Chrome settings enabling my site for any action Chrome specifies. No change.
Similarly for Firefox. No effect.
The attached photo shows how the Microsoft browsers display my intended effect.
Any idea what browser rule I'm violating here?
4 Feb 2016 I'm adding this link to the application discussed as it is running on my server, which therefore allows access to both the JavaScript and JSON code. Although this is a private application of no use to anyone but myself I cannot understand why the techniques used operate only within the two Microsoft browsers. A Mac-using friend confirmed today that Firefox doesn't show the image, and Safari won't even enable the links on the first page! If there is something I'm doing wrong here, I'd love to know what it is!
http://www.michaelbroschat.com/film/discCatalog.html
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/
I'm trying to adjust a set of divs to fit the "Avery" business-card printer paper. What this thing does it allows the user to print out the content of a dynamic number of divs (as business-card shaped) unto a specific type of paper to easily separate the pieces post-printing.
My problem is that every browser displays the "window.print()" content differently. If I try to set up the divs to fit the printer-paper under Chrome (for example) it won't work well if the user prints the same document from Opera or Firefox.
I tried three browsers so far (Opera, Firefox and Chrome), and each one of them displays the content slightly differently. The problem with this is that I can't control which browser the end-users will utilize when printing.
Is there a way to create a file that is read equally from any browser? I know the pdf is suppose to do that, but is there a way to dynamically generate a pdf in js or jquery?
Thanks much in advance.
You can use jsPDF
http://jquer.in/random-jquery-plugins-for-superior-websites/jspdf/
See live example:
http://parall.ax/products/jspdf
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.