forked from wojtekmaj/react-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation on standard fonts, update all samples to use standa…
…rd fonts Closes wojtekmaj#961
- Loading branch information
Showing
18 changed files
with
187 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
**/dist/* | ||
**/node_modules/ | ||
**/public/cmaps/* | ||
**/public/standard_fonts/* | ||
**/public/pdf.worker.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build | ||
node_modules | ||
public/cmaps | ||
public/standard_fonts | ||
public/pdf.worker.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
function copyDir(from, to) { | ||
// Ensure target directory exists | ||
fs.mkdirSync(to, { recursive: true }); | ||
|
||
const files = fs.readdirSync(from); | ||
files.forEach((file) => { | ||
fs.copyFileSync(path.join(from, file), path.join(to, file)); | ||
}); | ||
} | ||
|
||
const standardFontsDir = path.join( | ||
path.dirname(require.resolve('pdfjs-dist/package.json')), | ||
'standard_fonts', | ||
); | ||
const targetDir = path.join('dist', 'standard_fonts'); | ||
|
||
copyDir(standardFontsDir, targetDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
function copyDir(from, to) { | ||
// Ensure target directory exists | ||
fs.mkdirSync(to, { recursive: true }); | ||
|
||
const files = fs.readdirSync(from); | ||
files.forEach((file) => { | ||
fs.copyFileSync(path.join(from, file), path.join(to, file)); | ||
}); | ||
} | ||
|
||
const standardFontsDir = path.join( | ||
path.dirname(require.resolve('pdfjs-dist/package.json')), | ||
'standard_fonts', | ||
); | ||
const targetDir = path.join('dist', 'standard_fonts'); | ||
|
||
copyDir(standardFontsDir, targetDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
function copyDir(from, to) { | ||
// Ensure target directory exists | ||
fs.mkdirSync(to, { recursive: true }); | ||
|
||
const files = fs.readdirSync(from); | ||
files.forEach((file) => { | ||
fs.copyFileSync(path.join(from, file), path.join(to, file)); | ||
}); | ||
} | ||
|
||
const standardFontsDir = path.join( | ||
path.dirname(require.resolve('pdfjs-dist/package.json')), | ||
'standard_fonts', | ||
); | ||
const targetDir = path.join('dist', 'standard_fonts'); | ||
|
||
copyDir(standardFontsDir, targetDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters