Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename #2

Open
jirmed opened this issue Dec 15, 2017 · 2 comments
Open

Filename #2

jirmed opened this issue Dec 15, 2017 · 2 comments

Comments

@jirmed
Copy link

jirmed commented Dec 15, 2017

First of all thank you for the nice library.

I cannot deploy the library to the ABAP as described in your documentation due to an old version NetWeaver in our system. I was able to install to a BSP application by manually importing the nabi-m.zip into the BSP Mime though.

I have added mobi.m into data-sap-ui-libs, the path "nabi.m":"./resources/nabi/m" into data-dap-ui-resourceroots in sap-ui-bootstrap and nabi.m into dependencies/libs in manifest.json.

It works fine but with two issues with the PDF's filename:

  1. If I specify the file name without path. The library looks into folder server:port/application/resources/nabi/m/thirdparty/pdfjs/web/. I have a workaround for this ex. using "../../../../../../static/OpenUI5.pdf" works fine.
  2. I need to use a dynamic URI to get the PDF. The path to the pdf looks like http://server:port/application//attachment.htm?p_inline=X&p_instid=4995001&p_typeid=BUS2012. Ie there are three GET parameters in the URI. At first I have replaced & with &. Unfortunately then it always trims the URI at the first "=" sign. It uses only http://server:port/application//attachment.htm?p_inline. The rest of the URI is cut off. I have tried replacing the equal sign with = but with no success. I have also tried using formatter for the src string and forming the entire URI in JavaScript but with the same result. Is there any solution or workaround for this?

Regards

Jiri

@jirmed
Copy link
Author

jirmed commented Dec 18, 2017

I have found the a solution for the second issue myself. The trick is using function encodeURIComponent( ) for the URI string including all the parameters. In my case the result string is something like ..%2F..%2F..%2F..%2F..%2F..%2Fattachment.htm%3Fp_inline%3DX%26p_instid%3D9916000002%26p_typeid%3DBUS2012

I still wonder if there is some solution how to set the default path to the root of the application in order to avoid the ../../../../../../ prefix

@nzamani
Copy link
Owner

nzamani commented Jan 23, 2018

The issue you mentioned is a known drawback. It is caused because of the way I create the pdfviewer. In a future release I plan to change this. Once done, you won't have any issues with urls anymore. Stay tuned, however, this might take time...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants