Title: PDF: pixelDensity(2) throws off scaling when creating PDFs using beginRecord() and createGraphics(PDF) · Issue #6216 · processing/processing · GitHub
Open Graph Title: PDF: pixelDensity(2) throws off scaling when creating PDFs using beginRecord() and createGraphics(PDF) · Issue #6216 · processing/processing
X Title: PDF: pixelDensity(2) throws off scaling when creating PDFs using beginRecord() and createGraphics(PDF) · Issue #6216 · processing/processing
Description: Description With pixelDensity(2) enabled, PDF exports using offscreen buffers like beginRecord() and createGraphics(PDF) need to be scaled by 0.5 (1 / float(pixelDensity)) to have the expected result. Steps to Reproduce import processing...
Open Graph Description: Description With pixelDensity(2) enabled, PDF exports using offscreen buffers like beginRecord() and createGraphics(PDF) need to be scaled by 0.5 (1 / float(pixelDensity)) to have the expected resu...
X Description: Description With pixelDensity(2) enabled, PDF exports using offscreen buffers like beginRecord() and createGraphics(PDF) need to be scaled by 0.5 (1 / float(pixelDensity)) to have the expected resu...
Opengraph URL: https://github.com/processing/processing/issues/6216
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PDF: pixelDensity(2) throws off scaling when creating PDFs using beginRecord() and createGraphics(PDF)","articleBody":"## Description\r\nWith pixelDensity(2) enabled, PDF exports using offscreen buffers like beginRecord() and createGraphics(PDF) need to be scaled by 0.5 (1 / float(pixelDensity)) to have the expected result. \r\n\r\n## Steps to Reproduce\r\n```\r\nimport processing.pdf.*;\r\n\r\nvoid settings()\r\n{\r\n pixelDensity(2);\r\n size(500, 500);\r\n}\r\n\r\nvoid setup()\r\n{\r\n beginRecord(PDF, \"test.pdf\");\r\n\r\n //scale(1 / float(pixelDensity)); // uncomment to get expected pdf output\r\n background(0, 255, 0);\r\n rect(0, 0, width, height, 100, 100, 100, 100);\r\n\r\n endRecord();\r\n}\r\n\r\nvoid draw() {}\r\n\r\nvoid exportUsingPGraphics()\r\n{\r\n PGraphics pdf = createGraphics(width, height, PDF, \"test_usingpgraphics.pdf\");\r\n pdf.beginDraw();\r\n pdf.background(0, 0, 255);\r\n //pdf.scale(1 / float(pixelDensity)); // uncomment to get expected pdf output\r\n pdf.fill(255, 0, 0);\r\n pdf.rect(0, 0, width, height, 100, 100, 100, 100);\r\n pdf.dispose();\r\n pdf.endDraw();\r\n}\r\n\r\nvoid keyReleased()\r\n{\r\n exportUsingPGraphics();\r\n}\r\n\r\n```\r\n\r\n## Your Environment\r\n* Processing version: 3.5.4\r\n* Operating System and OS version: macOS Mojave 11.4 (20F71)\r\n\r\n","author":{"url":"https://github.com/rapatski","@type":"Person","name":"rapatski"},"datePublished":"2021-08-26T13:02:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/6216/processing/issues/6216"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a0e0beba-5444-35c7-47dc-c6c0e71b8b5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC1C:240DB3:3644BA:4C5660:696FA582 |
| html-safe-nonce | 97f451903a5c1ebd2d545d955de0748ea1bd3eec1482e161ba7c33fb2d83955a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzFDOjI0MERCMzozNjQ0QkE6NEM1NjYwOjY5NkZBNTgyIiwidmlzaXRvcl9pZCI6IjQ3MTcyNzE4MjExNjM5MzEwMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f1752377739bfa010b10952955549a977f93d66ac6b933d1974de191510fd031 |
| hovercard-subject-tag | issue:980221250 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing/6216/issue_layout |
| twitter:image | https://opengraph.githubassets.com/960af5182a749b63a30ca62b252b8bf86034c75525040c0955e0fff9814b6320/processing/processing/issues/6216 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/960af5182a749b63a30ca62b252b8bf86034c75525040c0955e0fff9814b6320/processing/processing/issues/6216 |
| og:image:alt | Description With pixelDensity(2) enabled, PDF exports using offscreen buffers like beginRecord() and createGraphics(PDF) need to be scaled by 0.5 (1 / float(pixelDensity)) to have the expected resu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rapatski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0ca8d8c65612640b9a1a588b3eed68222ca723ed2d028b18fe81b28936d535eb |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing git https://github.com/processing/processing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 7807399 |
| octolytics-dimension-repository_nwo | processing/processing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7807399 |
| octolytics-dimension-repository_network_root_nwo | processing/processing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 95f60616ce2765d1114fe6da4af405a58c6d26d2 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width