Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wojtekmaj/react-pdf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.3.0
Choose a base ref
...
head repository: wojtekmaj/react-pdf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.3.1
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Jul 27, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    eps1lon Sebastian "Sebbie" Silbermann
    Copy the full SHA
    5bbf9f7 View commit details

Commits on Aug 1, 2023

  1. Copy the full SHA
    89bf183 View commit details
  2. Copy the full SHA
    a1ef912 View commit details
  3. v7.3.1

    wojtekmaj committed Aug 1, 2023
    Copy the full SHA
    0186f91 View commit details
Showing with 17 additions and 7 deletions.
  1. +2 −2 README.md
  2. +9 −1 package.json
  3. +3 −1 src/shared/propTypes.ts
  4. +2 −1 test/Test.tsx
  5. +1 −2 test/shared/types.ts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -209,15 +209,15 @@ Check the [sample directory](https://github.com/wojtekmaj/react-pdf/tree/main/sa
If you want to use annotations (e.g. links) in PDFs rendered by React-PDF, then you would need to include stylesheet necessary for annotations to be correctly displayed like so:

```ts
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
import 'react-pdf/dist/Page/AnnotationLayer.css';
```

### Support for text layer

If you want to use text layer in PDFs rendered by React-PDF, then you would need to include stylesheet necessary for text layer to be correctly displayed like so:

```ts
import 'react-pdf/dist/esm/Page/TextLayer.css';
import 'react-pdf/dist/Page/TextLayer.css';
```

### Support for non-latin characters
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-pdf",
"version": "7.3.0",
"version": "7.3.1",
"description": "Display PDFs in your React app as easily as if they were images.",
"type": "module",
"sideEffects": [
@@ -15,6 +15,14 @@
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./dist/Page/AnnotationLayer.css": {
"import": "./dist/esm/Page/AnnotationLayer.css",
"require": "./dist/cjs/Page/AnnotationLayer.css"
},
"./dist/Page/TextLayer.css": {
"import": "./dist/esm/Page/TextLayer.css",
"require": "./dist/cjs/Page/TextLayer.css"
},
"./dist/cjs/Page/AnnotationLayer.css": "./dist/cjs/Page/AnnotationLayer.css",
"./dist/cjs/Page/TextLayer.css": "./dist/cjs/Page/TextLayer.css",
"./dist/esm/Page/AnnotationLayer.css": "./dist/esm/Page/AnnotationLayer.css",
4 changes: 3 additions & 1 deletion src/shared/propTypes.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import PropTypes from 'prop-types';
import { allEvents } from 'make-event-props';
import { PDFDataRangeTransport } from 'pdfjs-dist';
import pdfjs from 'pdfjs-dist';

import { isDefined } from './utils.js';

import LinkService from '../LinkService.js';

import type { Validator } from 'prop-types';

const { PDFDataRangeTransport } = pdfjs;

type AllEvents = (typeof allEvents)[number];

type Props = {
3 changes: 2 additions & 1 deletion test/Test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useCallback, useEffect, useState } from 'react';
import { PDFDataRangeTransport } from 'pdfjs-dist';
import { pdfjs, Document, Outline, Page, Thumbnail } from 'react-pdf';
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
import 'react-pdf/dist/esm/Page/TextLayer.css';
@@ -18,6 +17,8 @@ import { isArrayBuffer, isBlob, isBrowser, loadFromFile, dataURItoBlob } from '.
import type { PDFDocumentProxy, PDFPageProxy } from 'pdfjs-dist';
import type { ExternalLinkTarget, File, PassMethod, RenderMode } from './shared/types.js';

const { PDFDataRangeTransport } = pdfjs;

pdfjs.GlobalWorkerOptions.workerSrc = new URL(
'pdfjs-dist/build/pdf.worker.min.js',
import.meta.url,
3 changes: 1 addition & 2 deletions test/shared/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PDFDataRangeTransport } from 'pdfjs-dist';

import type { PDFDataRangeTransport } from 'pdfjs-dist';
import type { BinaryData } from 'pdfjs-dist/types/src/display/api.js';

export type Source =