ASP.NET Display part of a PDF - pdf

I need to display a PDF in an ASP.NET web page and specify the Zoom, X/Y coordinates and page to display. Can this be done?
Thank you

It is possible to use Adobe reader and enter parameters when opening the PDF:
http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf

You might be able to pull it off with, say, a Flash PDF viewer (for example, see Scribd) for the best cross-platform (Windows, OS X, Linux) solution.
If you just want to embed PDF in a web page, you might have to use an iFrame and use browser capabilities (Adobe Reader plugin, Google Chrome PDF reader) if you want to support all browsers.

Related

Access DOM embedded PDF in Chrome

Is it possible to access the DOM of a embedded PDF file opened in Chrome?
If you simply open the DevTools in Chrome, only the EMBED tag is visible:
But there is a mouse over PDF file opened in Chrome and right-click => code view, then a completely different page code opens:
Can I get access to it?
Thank you in advance!
Yeah so it looks like you've got multiple documents on a page. Its similar to iFrames in web design. I'm not sure 100% because I cant look through the link.
But I'd highly recommend downloading the PDF as a file, then using ADOBE Pro's library to scrape or w/e with the PDF functions. You eliminate the whole aspect of timing, page loads, and page changes, when you get a direct link to a pdf, and then manipulate the data on the user or cloud PC.

Edit texts in a PDF on Chrome using Chrome inspect

Is there any way to modify texts in PDF on Chrome using the Chrome inspect tool? I was stuck because in the Chrome inspect element, differently than any other websites and even PowerPoint presentations opened in Chrome, I'm able to modify texts, while with PDFs I cannot. Does anyone know how to do it?
Edit: Yes I know that the changes made through Chrome DevTools are temporary, but usually I'm able to make those changes, even if they're temporary. But with PDFs I can't.
There are differences in the way some browsers handle PDF data.
Chromium based browsers are more traditional in that the PDF plug-in is based on a Foxit/Skia collaboration, So you need to understand in that case, the downloaded PDF you are viewing is in the binary application/pdf (file already outside of the html wrapper).
Just as you cannot edit the PDF text in Acrobat Reader, the most you can do is incrementally add comments/annotation or field data to the end of the file, before save as a secondary download. The server cannot see your changes unless you submit as an upload.
With Firefox and Google docs there is often a different approach where the PDF is "Repr"oduced as an "Ex"ample (A ReprEx of the PDF) so it is built of a hybrid image and text overlay to emulate that part of the real PDF source. When you previously or later save the underlying downloaded PDF (for viewing) it would not necessarily include any browser based HTML editing, in the saving.
There are other techniques for other cases, but to answer the basic OP question most simply, the answer is NO you cannot change a PDF body, only add notes, etc via extensions. Microsoft variant of Chrome I.E. Edge has some inbuilt annotation ability thus does not need a second extension.
Found this question because I was googling a similar situation--I was wanting to manipulate type sizes and margins on a PDF in inspector via Chrome. I found that FireFox DevTools will allow you to view those styles and even alter the content in the PDF while in browser. I am late to the game but hope this provides answers for someone else in the future.

Disable PDF printing in Firefox by web developer

I am developing a web page to show PDF (in .NET platform). The PDF is inside a iframe. One of the requirement is NOT allow client to print the PDF. I have already made the PDF to be password protected (with pdfsharp). I further hide the toolbar by setting toolbar=0. In Chrome & IE, this works fine. But for Firefox, the story is totally different.
In Firefox, the toolbar will be shown even append #toolbar=0 in the src link. Further, the password protected pdf can be printed by simply clicking the icon in the toolbar.
Can anyone suggest some ways to disable pdf printing in firefox.
Note: I need to show the PDF in the webpage. So, download the PDF is not a option.
You will not be able to control the toolbar or the ability to print (not all PDF viewers respect the permissions set by the password) if you rely on the native browser or OS level PDF viewer by using an iFrame. Different browsers will interpret those settings differently. Even different applications within the same browser will yield different results (Chrome vs Dropbox in Chrome)
You'll need to display the PDF using something like PDF.js or another such library if you want any kind of consistency in appearance and behavior.

How to get page coordinates inside pdf document onclick

Is there any API in js or .net or any other free tool through which page coordinates can be obtained in a pdf? Basically, I have a pdf file which contains images so I have read the coordinates on click inside the pdf document.
*coordinates here refer to .pdf page coordinates and not pixel coordinates, however I used itext library but couldn't figure out the solution.
In order to read the coordinates of an image when it's clicked on in the PDF, you're going to need to use a PDF viewer that is capable of running scripts. Unfortunately, there are only a few of those and they all implement only a portion of the Acrobat JavaScript API but the Acrobat JavaScript API can't tell you anything about images or their location so it's doubtful that any of the others would. However, you could create a plug-in to Reader and/or Acrobat and add that functionality but then all of your users would need to install both Acrobat/Reader and your plug-in.
Assuming I understood the user experience you are looking for, I don't think it's possible without a customized viewer.

In search of a lightweight pdf viewer

I am looking for a lightweight pdf viewer ( commercial / free) for my windows application.
I presently display the pdf documents on a webbrowser with Adobe Reader Plug-ins.
Background :
The problem i am having with Adobe Reader is the Loading time. To display a pdf document for the very first time, Adobe Reader nearly takes 15 seconds !! .The application when deployed on customer locations (usually run on Windows Embedded OS) the pdf viewing time is still worse, sometimes takes more than a minute.
Hence i need to find an alternative for Adobe Reader.
My simple requirements are :
Lightweight - viewer should initialise itself and load the pdf as
fast as possible.
SVG support.
If anyone has any idea regarding such a tool. Kindly let me know
Regards
Srivatsa
Try : Foxit PDF SDK
Try SumatraPDF (Download full kit for MOZ plugin npPDFViewer.dll sorry there is NO IE.OCX)
For a minimal install use with the portable executable in same directory and you can call via DDE or command line
I think best light weight option for Windows is MuPDF for those who would rather not use any plugin in the Chrome.
http://mupdf.com/