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
import { PDFDocument, PDFRawStream } from 'pdf-lib'; | |
import * as FileType from 'file-type'; | |
import Jimp from 'jimp'; | |
const extractImageFromPDF = async (file: Buffer) => { | |
const pdfDoc = await PDFDocument.load(file, { ignoreEncryption: true }); | |
const indirects = pdfDoc.context.enumerateIndirectObjects(); | |
const images = []; | |
for (let i = 0; i < indirects.length; i += 1) { | |
const [, pdfObject] = indirects[i]; |
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
[ | |
{ | |
"name": "Swedish", | |
"nativeName": "svenska", | |
"iso": "sv" | |
}, | |
{ | |
"name": "Albanian", | |
"nativeName": "Shqip", | |
"iso": "sq" |
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
.PHONY: build test help | |
.DEFAULT_GOAL := help | |
NODE_ENV ?= development | |
help: | |
@grep -P '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
# If the first argument is one of the supported commands... |
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
# https://github.com/gpakosz/.tmux | |
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, | |
# without any warranty. | |
# Copyright 2012— Gregory Pakosz (@gpakosz). | |
# -- navigation ---------------------------------------------------------------- | |
# if you're running tmux within iTerm2 | |
# - and tmux is 1.9 or 1.9a |