drawImage results in text being inserted into PDF #1632
BrianErickson-InfoCon
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to embed an image into a PDF. All I get is a PDF with text in it.
I want the image to have no scale. The images are always JPEG.
I've attached the input JPEG image and resulting output PDF.
What I'm I doing wrong?
code:
import {PDFDocument, PDFImage } from 'pdf-lib';
const fs = require('fs');
export class MyPDFGenerator
{
async PDFAddPage(
pdfDoc: PDFDocument,
Input: string): Promise
{
let imgPage:PDFImage;
const getPdf = new MyPDFGenerator;
// const pdfDoc = await PDFDocument.create();
await getPdf.TestAddPage(sInputFile);
// PDF Close ---
// fs.writeFileSync(sExpectedPDFName, await ((await pdfDoc).saveAsBase64()));
};
Using Typescript and NodeJS
OS: Rocky Linux
MyTest2.pdf
Beta Was this translation helpful? Give feedback.
All reactions