Skip to content

Commit

Permalink
fix: ensure we are passing PDF to pdfinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Dec 12, 2024
1 parent 571b660 commit 600e633
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/pdf/convertPDFToImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export async function convertPDFToImages(
input: ConvertPDFToImagesInput
): Promise<Buffer> {
const { contents, workspace, noLimits, name } = input;
const pdfPath = path.join(
workspace.location,
name ? path.basename(name) : 'Default.pdf'
);
const fileName = name
? path.basename(name).replace(/\.pptx?$/i, '.pdf')
: 'Default.pdf';
const pdfPath = path.join(workspace.location, fileName);

if (!existsSync(pdfPath)) {
await writeFile(pdfPath, Buffer.from(contents as Buffer));
Expand Down

0 comments on commit 600e633

Please sign in to comment.