Как изменить заголовок страницы браузера, на которую сервлет транслировал PDF?

То, что вы ищете, это стандарт границ слов в Юникоде:

http://unicode.org/reports/tr29/tr29-9.html#Word_Boundaries

Здесь есть реализация JavaScript (unciodejs.wordbreak.js)

https://github.com/wikimedia/unicodejs

11
задан Bill the Lizard 26 March 2011 в 14:52
поделиться

2 ответа

Добавьте этот заголовок в свой HttpServletResponse:

response.setHeader("Content-Disposition","inline; filename=Here is the Amazing PDF");

Я считаю, что браузер уловит его и используйте его как заголовок окна.

8
ответ дан 3 December 2019 в 08:05
поделиться

Может быть, я ' Something like this:

<html>
  <head>
      <title>Here is the amazing PDF</title>
      <style type="text/css">
       html, body, div, iframe { margin:0; padding:0; height:100%; }
       iframe { display:block; width:100%; border:none; }
      </style>
  </head>
  <body>
    <iframe width="100%" length="100%" src="myApp/FetchPDFServlet?id=123"/>
  </body>
</html>

So instead of linking to a pdf document using myApp/FetchPDFServlet?id=123, you would link to something that returns the above html. For example, a jsp page: myApp/ShowPDF.jsp?id=123&title=Here%20is%20the%20amazing%20PDF

4
ответ дан 3 December 2019 в 08:05
поделиться
Другие вопросы по тегам:

Похожие вопросы: