File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,11 +146,11 @@ export async function rotatePDF(pdfBuffer: Buffer, direction: '90' | '180' | '27
146146
147147/**
148148 * Converts a PDF to PDF/A.
149- *
149+ *
150150 * @param pdfBuffer - Buffer of the PDF to convert
151151 * @param options - Options for the conversion
152152 * @param options.version - PDF/A version to convert to. Defaults to 1.
153- * @returns
153+ * @returns
154154 */
155155export async function convertToPDFA (
156156 pdfBuffer : Buffer ,
@@ -210,7 +210,7 @@ export async function renderPDFPagesToPNG(
210210 outFiles . push ( await fs . readFile ( outDir + '/' + i + '.png' ) ) ;
211211 }
212212
213- await fs . rmdir ( outDir , { recursive : true } ) ;
213+ await fs . rm ( outDir , { recursive : true } ) ;
214214 return outFiles ;
215215 } ) ;
216216 } catch ( e : any ) {
@@ -234,8 +234,8 @@ export async function isValidPDF(pdfBuffer: Buffer): Promise<boolean> {
234234 */
235235export async function compressPDF ( pdfBuffer : Buffer | string , encoding ?: BufferEncoding ) : Promise < Buffer > {
236236 try {
237- if ( typeof pdfBuffer === 'string' ) {
238- pdfBuffer = Buffer . from ( pdfBuffer , encoding ?? 'base64' )
237+ if ( typeof pdfBuffer === 'string' ) {
238+ pdfBuffer = Buffer . from ( pdfBuffer , encoding ?? 'base64' ) ;
239239 }
240240 const compressedPdf = await useTempFilesPDFInOut ( pdfBuffer , async ( input , output ) => {
241241 await exec (
You can’t perform that action at this time.
0 commit comments