0

ZK 9.5 PdfViewer

asked 2020-12-02 23:47:44 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Only a question or hint. We change our current pdf viewer to the new PdfViewer from ZK. Our pdf pages are all in landscape mode (not normal portrait mode) created. So i must to initialize the new PdfViewer with

pdfViewer.setRotation(90); // because, orientation of the reports is landscape

Is there no automatic that the pdfViewer knows the print mode of the media (protrait/landscape) when gets the pdf ?

thanks Stephan

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-12-29 16:19:25 +0800

MDuchemin gravatar image MDuchemin
1856 1 5
ZK Team

Hey there!

auto rotate is now available for PDFs that include page orientation by default :)

try it out in current FL: 9.5.1.FL.20201228(-Eval)

link publish delete flag offensive edit
0

answered 2020-12-03 14:57:50 +0800

MDuchemin gravatar image MDuchemin
1856 1 5
ZK Team

Hi Terrytornado,

That's a pretty good suggestion, will be stealing that :) here's the feature request: https://tracker.zkoss.org/browse/ZK-4740

You can override it, but only by overriding the whole /web/js/zkex/pdfviewer/Pdfviewer.src.js and /web/js/zkex/pdfviewer/Pdfviewer.js files in your project.

You can update here:

    _getPage: function _getPage(pageNum) {
  var _this3 = this;

  var pdfFirstRender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  if (!this._pdf) return;

  if (this._pageRendering) {
    this._pendingPageNum = pageNum;
    return;
  }

  this._pageRendering = true;
  return this._pdf.getPage(pageNum).then(function (page) {
    var viewport = page.getViewport({
      scale: _this3._zoom,
      rotation: _this3._rotation += page._pageInfo.rotate //THIS PART ADDING THE ROTATION
    }),

I've also put in a feature request to improve on that, and allow granular overrides.

https://tracker.zkoss.org/browse/ZK-4739

link publish delete flag offensive edit

Comments

Many thanks MDuchemin

terrytornado ( 2020-12-04 23:22:09 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-12-02 23:47:44 +0800

Seen: 16 times

Last updated: Dec 29 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More