crabbly / crabbly/Print.js

Printing HTML generated by .map

Open
#648 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.5k
Forks
688
PR merge metrics
No merged PRs in 30d

Description

Trying to create a PDF of articles. The articles are displayed on the page by mapping through its sub-sections. This works when there is only one sub-section, but doesn't even trigger the browser's print pane when there's more than one. Is this something dumb that I'm doing or a limitation of the library?

```
const createPDF = async () => {
print("pdf", "html")

}
```

```
create pdf


{article?.attributes?.section.map((sec) =>


{sec.title}

{parse(sec.content)}


)}

```

```
"dependencies": {

"@react-pdf/renderer": "^3.0.0",
"axios": "^0.27.2",
"cookie": "^0.5.0",
"cookie-cutter": "^0.2.0",
"daisyui": "^2.31.0",
"graphql": "^16.6.0",
"html-react-parser": "^3.0.4",
"html2canvas": "^1.4.1",
"js-cookie": "^3.0.1",
"jspdf": "^2.5.1",
"next": "12.2.5",
"next-auth": "^4.12.2",
"print-js": "^1.6.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"autoprefixer": "^10.4.12",
"eslint": "8.22.0",
"eslint-config-next": "12.2.5",
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8"
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.