Skip to content

Commit

Permalink
[SVG] Specify the PDFJS.cMapUrl/PDFJS.cMapPacked parameters in th…
Browse files Browse the repository at this point in the history
…e svgviewer example

Re: issue 7017.
This should prevent the error, but does not fix the broken rendering.

The rendering issues are caused by `svg.js` not supporting the various text rendering modes, in this case specifically "invisible" (as indicated in the console `Warning: Unimplemented method setTextRenderingMode`).

Compared to the canvas case, where we just ignore invisible text, a smarter solution is probably required for the SVG case. Since just ignoring invisible text in `svg.js` would mean that text-selection isn't possible.
  • Loading branch information
Snuffleupagus committed Feb 26, 2016
1 parent 0c19d84 commit 4a65756
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/svgviewer/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ require(['pdfjs/display/api', 'pdfjs/display/svg'], function (api, svg) {
// In production, change this to point to the built `pdf.worker.js` file.
PDFJS.workerSrc = '../../src/worker_loader.js';

// In production, change this to point to where the cMaps are placed.
PDFJS.cMapUrl = '../../external/bcmaps/';
PDFJS.cMapPacked = true;

// Fetch the PDF document from the URL using promises.
api.getDocument(url).then(renderDocument);
});

0 comments on commit 4a65756

Please sign in to comment.