Opening a local PDF file in Chrome - pdf

Ok I see these 2 questions:
How to open PDF file in Google Chrome in new tab?
Can Google Chrome open local links?
But I'm not sure they answer my question. I'm trying not to install any PDF reader (Adobe sucks) and know that Chrome will open PDFs I open from the internet. So my question, is why won't it work if the PDF is local to my machine? Is there a workaround/plugin/other browser I can use to accomplish this?
The argument of security is totally bogus; how would a PDF I'm opening on the internet be any more secure/safe than a PDF I have on my local machine?

I'm running Chrome 8.0.552.18 on my computer now, under Windows 7, and I just clicked and dragged a PDF onto it, and it loaded it up no problem...
And no, it doesn't look like it's using Acrobat or Foxit, or another PDF reader... it looks like Chrome 8 does have its own PDF renderer.

I'm assuming you are on Windows. So, if your PDF is c:\some\path\some.pdf, simply use this URI in Chrome's address and search field:
file:///C:/some/path/some.pdf
On Linux I'd expect this for /some/path/some.pdf to change to
file:///some/path/some.pdf
(but have no chance to test this).

When you say "open a PDF in Chrome", what do you mean, exactly? Are you opening it through Gmail or Google Docs? If so, that's Google doing conversion behind the scenes, converting it to HTML on their servers, with Chrome simply rendering the HTML as usual.
As far as I'm aware, Chrome has no built-in PDF viewing capabilities.
edit looks like Chrome 8 does have its own PDF viewer built-in. Wowj.

Related

PDF loads on computer but downloads on mobile

I have my resume hosted on resume.momohossa.in
My issue is that when I try to reach this site on my computer, it just opens in a new page. However, when I try to open it on my phone, it has to download the file. Then, I have to open the downloaded file on a PDF viewer such as adobe. I would like for it to not immediately download on my phone. Does anyone have any advice?
Thank you in advance!
By default, on iOS devices, its safari browser can view PDF file directly, and for android deveices, its chrome browser also can do that.
make sure you pdf file is not a stream output file. just make it a static file, e.g. http://host/target.pdf not http://host/pdf/target

Can pdf and doc files be opened in a browser using coldfusion

Can a pdf file or a doc/docx file be opened in a browser? I have a link which when clicked opens up the document as such in pdf and in MS word. But is it possible to open them in browser using Coldfusion?
thanks in advance
ColdFusion has little to do with how they are opened in the browser. That depends on how the user's browser is configured. If it is configured to open in a standalone app, then it will do so, if it is configured to open in the browser then it will do that. You have some influence if you are serving the file via ColdFusion using the <cfcontent> tag, but since you have provided no code or any explanation of how you are serving these files I will assume you are just doing something like pdf which will just load the file in the browser and the browser determines whether to download it or view it directly.
If you are using <cfcontent> to serve the file then you can also use <cfheader> and send the file as either inline or an attachment which can help tell the browser how it should load it. That said, it is still up to the browser's configuration.
Something like:
<cfheader name="Content-Type" value="application/pdf" />
<cfheader name="Content-Disposition" value="inline;filename=mypdf.pdf;" />
<cfcontent type="application/pdf" reset="true" variable="#myPDFBinary#" />
would serve a PDF binary, telling the browser to load it inline, which should, if properly configured, open the PDF in the browser.
This is not something that ColdFusion can address. This has to do with the particular web browser being used and what related software a user has installed locally.
If the user has a browser that supports PDF natively (e.g. Chrome) or they have the Adobe Acrobat browser plugin installed, then the PDF will open in the browser. Otherwise, it will open in the Acrobat program or any program they have that can view PDF documents. There is no MS Word plugin for browsers, so the browser will always try to open a .doc file in MS Word (if they have it installed) or any other program they have that can read that type of file.

XFDF URL reference to PDF form not working

I'm populating a PDF form using XFDF. The XFDF is produced by my Java webapp. I want to reference the PDF form from XFDF using a URL because I want form templates to be stored on the server. The form is password-protected, so I can't flatten it server-side with iText.
Using a local path works fine:
<f href="C:\Users\...\MyForm.pdf"/>
but a URL fails:
<f href="http://localhost:8080/app/servlet/PdfForm?id=176"/>
From the article below it seems it's possible, but I've looked through the XFDF spec and it doesn't mention URLs, only local paths:
http://wiki.developerforce.com/page/Adobe_XFDF
Neither Acrobat Reader X nor Acrobat Pro X seem to handle it. The browser fires up but and form doesn't get merged. I've tried changing default browser from Chrome to Firefox to IE with no luck.
Does anyone know if a URL reference works?
I think the URL should be only http://xx.xxx/xxx/test.pdf, a pdf form, not a stream.
I was able to open it in Internet Explorer on a PC with Adobe Acrobat Reader DC installed, but other browsers seem to be unable to do so.
Reference: https://helpx.adobe.com/jp/acrobat/using/display-pdf-in-browser.html

How to force to show PDF in google chrome using Adobe PDF Plug-In only

I am facing a problem while showing a pdf in Google Chrome. The issue is that Chrome shows some pages of the pdf as black.
This happens when Chrome PDF Viewer is enabled. If I disable this plug-in and use Adobe PDF Plug-In it works fine.
Is there any way to show a PDF in Google Chrome using the Adobe PDF Plug-In only.
AS I am showing PDF using an HTML object tag, is there any parameter which forces Chrome to show the PDF using Adobe PDF Plug-In?
There's no way for a website to force the browser to use one renderer or another: those decisions are all made client-side. As you noted, disabling the Chrome PDF plugin bubbles the Adobe plugin to the top, but that's a decision the user would have to make.
That said, if you have a PDF with rendering issues that you can share, please file a bug at http://new.crbug.com/. I'll be happy to put it in front of the correct team for triage.
The only way that you can be 100% that all users can open your PDF correctly currently, is to force that the PDF is downloaded.
Use some headers within your apache or backend.
Example for Apache
https://stackoverflow.com/a/11991050/3086639

External PDF highlighting with Safari browser not working!

We have been facing a weird problem with PDF documents displayed in Safari. This problem is reproducible in many of our machines. The problem is like this..
Adobe Reader has support for hit highlighting in PDF documents when it is being viewed in any browser. For example,
http://www.mysite.com/myfile.pdf#xml=http://www.somesite.com/words.txt
This URL should highlight the words specified in words.txt file. But, unfortunately many of our Safari browsers (on Windows machines) don't highlight any text in opened pdf file. The same URL works fine in rest of the browsers (IE, Firefox and Chrome). I could not figure out where the problem is!
Can anybody please help me on this?
Thanks in advance,
Safari uses a built-in PDF plugin exclusive to safari (even on iPhone)
This is different from the Adobe's plugin and the API is different too.
Most of the things that work with the Adobe plugin won't work with the one inside Safari.
you may be able to find information about forcing Safari to use the Adobe Reader plugin (Google is your friend) but that would be a per user setting, something you cannot control on everybody's machine.
I'm also looking for help on this to control pdf files inside safari using javascript.