Display Bitstreams in Google Docs Viewer - pdf

I've been embedding Google Docs Viewer in my DSpace instance, an online digital repository, using an iframe.
This is my site link: http://202.78.89.123:8081/xmlui/handle/123456789/145
DSpace generates bitstream links to each item/pdf in the repository. When I click the preview link, an iframe appears in my page but doesnt load any document. But when I change the source of my iframe to a pdf path file, which is publicly accessible in the world and not a bitstream, the viewer loads the document.
I have done everything I can, from checking whether my web server is publicly accessible by google docs viewer. My web server is publicly accessible and I suspect Google Docs Viewer doesnt anymore support bitstreams?If that's true then how will I display a pdf file in an iframe within my page? Any idea?
Below is my page that says "Apologies. There is no Preview Available"

The reason why I cant display the bitstreams on my google docs viewer is that even though my IP is publicly accessible, my ports are private. What I did is, make the ports public by setting it on the router.

Related

Provide a preview image for WhatsApp, when sharing a link to PDF from a website

I want to share a PDF that is hosted on our web servers to someone via Whatsapp.
Im aware of how you can get a preview image for sharing a website via Whatsapp, social media etc.. and there is already a great article for that on Stack overflow HERE. This method uses meta / html tags to provide the image.
The problem is that PDF's hosted on a web server are not webpages and thus cant have meta tags / html added to them. PDFs hosted on a web server are really just PDFs that get opened in the browser.
Is there any way i can get provide a preview image for WhatsApp, when sharing a link to PDF from a website. Eg. i would like to set a company logo as the preview image.

How do I add a link inside a PDF document that opens the same PDF in a user's default browser?

A client has asked that I include a "View in browser" link to a pdf attached to an email. This should open the same PDF in the user's default web browser. I have a PDF editor (PDFescape Desktop) that I can successfully use to add links to webpages, and it seems capable of opening files, and even executing javascript, though I've never tried it (I am proficient in JS though so that's an option if anyone has any ideas).
The only thing I can think of is to host the PDF somewhere and then link to it's location, but I'd rather not use a third party server if I can help it.
Is there any way to reference a link in a PDF to the same PDF the link exists in?

Displaying a PDF from AWS S3 in WebView causes download instead of displaying inline

When I try to view a PDF from an S3 bucket in a WebView, it downloads even though the Content-Type is set to application/pdf and the Content-Disposition to inline (tried without it as well) in the AWS Management Console.
<WebView source={{ uri: this.tosData.link }} />
When getting the URL directly from S3 and pasting into Chrome, it displays as expected, without downloading. If I host the PDF on something like Google Drive, and use that link instead, it also displays as expected. Any thoughts on what could be wrong?
while uploading pdf file into s3 add 'ContentDisposition': "inline" into header, this will help you to view the content instead of downloading.
ALL PDF viewers must in one way or another download a full web page including any referenced content such as a PDF whichever way it is embedded.
A browser may not or does not have to display the PDF since if it was a viral file it would be run without your permission. For that reason hardened browsers will download the pdf and not run the content.
You can add a flag to indicate, you say the pdf may be trusted for inline viewing, if the site page is trusted. that is why there is a setting that on handing ownership dis-position from server to client there are flags download or inline
download only
download and optionally view inline, is preferred by the site, but does not have to be complied with.
Globally PDF viewing is controled by the PDF viewer application and the browsers security settings, such as no window.open or other pop-up.

How to access BigCommerce internalapi?

I am trying to download (backup) images that customers upload for products that take custom logos (these are typically JPG, PNG, PDF, etc.) These customer files are downloadable by clicking on a hyperlink in the BigCommerce admin page for the order in question. The link is not a link to the image path but instead, a link to a service that sends the file to the browser. In other words, you have to be authenticated into the admin site to download the file. The URL looks like this:
https://mystore.com/internalapi/v1/orders/383945/products/251438/attributes/561518/download
https://mystore.com/internalapi/v1/orders/{order id}/products/{lineItem id}/attributes/{option id}/download
These are easily constructed in the API itself for a given order. If I use the link in a browser tab while I'm logged into the admin site, the file downloads.
But what I am trying to write an app to automatically download all the files (there are thousands). When I try to use this URL in an app, I get a authentication error. I tried at first using my regular API credentials but then used the credentials to log into the admin site. Both give me an authentication error.
I could not find anything documented on this so-called "internalapi." Anyone ever try to use this "internal" API that is used by the admin site?
I believe authentication is cookie based for that internal API, but there could be problems with using our non-publicly documented internal APIs in production, i.e. we may make future updates that would be breaking changes.
Images attached to orders through a file upload option also get copied to WebDAV, in the dav/product_images/configured_products folder. Another way to do this could be to use a WebDAV client library like easywebdav to connect and download the files.

Tracking downloads of PDF from external sites

I have a site which hosts several PDFs which are often linked to directly from other websites.
I want to be able to track (preferably with Google Analytics) whenever anyone lands on a PDF page from an external site.
It would also be great if I could track whenever an external site's page loads up my PDF using an <embed> tag with my PDF URL as the src attribute.
The usual _gaq.push (etc) method (eg, for this problem) doesn't work in this case because I can't modify the external sites.
Any help would be greatly appreciated. Thank you.