Open MehdiFal opened 8 years ago
I can see on the logs after adding type=pdf
: Found plugin by parameter type: pdf
but the name of the pdf displayed on the div #documentName
is myPDF12345
like my url and not like file-name returned on the Http response header. Also the PDF is not displayed.
Ok, so I updated my service to http://api.mydomain.com/ViewerJS/#//api.mydomain.com/docs/myPDF12345.pdf
The pdf name (the last portion of the url) is displayed but the pdf content is not even though downloaded.
This is probably related to the bug report I filed a while back: https://github.com/kogmbh/ViewerJS/issues/183
If the Content-Type head contains more then just application/pdf it won't detect it is a pdf and then won't even get the content.
for let's say
mydomain.com
I have 2 subdomains :static.mydomain.com
andapi.mydomain.com
.static.mydomain.com
: serves all the static content (images and JS dependencies) of viewer.jsapi.mydomain.com
: serves the index.html of viewer (in which I refer to all the dependencies using the absolute url //static.mydomain.com/Viewer/****.js) like the following :http://api.mydomain.com/ViewerJS/................
After some authentication flow etc... I'm able to consume and display my PDF on the browser such as : 'api.mydomain.com/docs/myPDF12345'
However when hitting the url of the viewer (which is displayed successfully)
http://api.mydomain.com/ViewerJS/#//api.mydomain.com/docs/myPDF12345
I'm unable to display it on the Viewer even though when I inspect the HTTP response it's shown downloaded :Status Code:200 OK Remote Address:127.0.0.1:80 Response Headers view source Access-Control-Allow-Origin:* Connection:close Content-Disposition:inline; filename=CV-12.pdf Content-Length:182767 Content-Type:application/pdf; charset=UTF-8
I also tried to add the
type=.pdf
param at the end of my url, but nothing showed up on the viewer.Any idea ?