2021-11-05 18:39:36 +01:00
|
|
|
import fs from 'fs'
|
|
|
|
import path from 'path'
|
|
|
|
import { fileURLToPath } from 'url'
|
2018-09-23 20:28:05 +02:00
|
|
|
|
2023-01-30 02:38:45 +01:00
|
|
|
import Resume from './resume.js'
|
2020-07-18 22:44:17 +02:00
|
|
|
|
2023-01-30 02:38:45 +01:00
|
|
|
const dirname = typeof __dirname === 'string'
|
|
|
|
? __dirname
|
|
|
|
: path.dirname(fileURLToPath(import.meta.url))
|
2021-02-14 15:46:32 +01:00
|
|
|
|
2021-11-05 18:39:36 +01:00
|
|
|
export const pdfRenderOptions = { mediaType: 'print' }
|
2020-11-03 17:44:00 +01:00
|
|
|
|
2021-11-05 18:39:36 +01:00
|
|
|
export const render = resume => {
|
2021-11-14 15:47:22 +01:00
|
|
|
const css = fs.readFileSync(path.resolve(dirname, 'style.css'), 'utf-8')
|
2020-07-05 14:54:30 +02:00
|
|
|
|
2023-01-30 02:38:45 +01:00
|
|
|
return Resume(resume, css)
|
2020-07-05 14:54:30 +02:00
|
|
|
}
|