Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jan 18, 2024
2 parents cf97170 + 1f5db84 commit 9faa01b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bsorrentino/pdf-tools",
"version": "1.1.0",
"version": "1.2.0",
"description": "",
"main": "index.js",
"bin": {
Expand Down
Binary file added samples/User_Installation_Guide_oracle.pdf
Binary file not shown.
10 changes: 8 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ async function extractImagesfromPages(pdfPath: string) {

const ops = await page.getOperatorList()

const ImageFromOp = (op: string):PDFImage =>
op.startsWith('g_') ?
page.commonObjs.get(op) :
page.objs.get(op);


for (let j = 0; j < ops.fnArray.length; j++) {

if (ops.fnArray[j] == OPS.paintJpegXObject || ops.fnArray[j] == OPS.paintImageXObject) {

const op = ops.argsArray[j][0];

const img = page.objs.get(op) as PDFImage;
const img = ImageFromOp(op);

//const scale = img.width / page._pageInfo.view[2];

Expand Down

0 comments on commit 9faa01b

Please sign in to comment.