Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Aug 14, 2024
1 parent 7fd09fb commit e8976ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion streamlit_pdf_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def pdf_viewer(input: Union[str, Path, bytes],
rendering=rendering,
pages_to_render=pages_to_render,
render_text=render_text,
ratio_boost=resolution_boost
resolution_boost=resolution_boost
)
return component_value

Expand Down
10 changes: 5 additions & 5 deletions streamlit_pdf_viewer/frontend/src/PdfViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ export default {
}
};
const createCanvasForPage = (page, scale, rotation, pageNumber, ratioBoost=1) => {
const createCanvasForPage = (page, scale, rotation, pageNumber, resolutionRatioBoost=1) => {
const viewport = page.getViewport({scale, rotation});
const ratio = (window.devicePixelRatio || 1) * ratioBoost
const ratio = (window.devicePixelRatio || 1) * resolutionRatioBoost
// console.log(ratio)
const canvas = document.createElement("canvas");
Expand Down Expand Up @@ -180,9 +180,9 @@ export default {
}
}
let ResolutionBoost = 1
let resolutionBoost = 1
if (props.args.ratio_boost) {
ResolutionBoost = props.args.resolution_boost
resolutionBoost = props.args.resolution_boost
}
for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) {
Expand Down Expand Up @@ -218,7 +218,7 @@ export default {
pageScales.value.push(scale)
pageHeights.value.push(unscaledViewport.height)
if (pagesToRender.includes(pageNumber)) {
const canvas = createCanvasForPage(page, scale, rotation, pageNumber, ResolutionBoost)
const canvas = createCanvasForPage(page, scale, rotation, pageNumber, resolutionBoost)
// console.log(`canvas`)
// console.log(canvas)
Expand Down

0 comments on commit e8976ac

Please sign in to comment.