Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

Currently Snippet388 showcases the PDF export by using Shell#print. This PR extends it to additionally provide the possibility to export a direct rendering on the GC.

@laeubi
Copy link
Contributor

laeubi commented Jan 6, 2026

This PR extends it to additionally provide the possibility to export a direct rendering on the GC

The snippet already prints an additional text when exporting to PDF so I'm not completely sure what is missing?

Also as we are painting to a canvas everything is already implicitly rendered through the GC anyways isn't it?

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Test Results (macos)

   54 files  ±0     54 suites  ±0   8m 37s ⏱️ + 1m 48s
4 513 tests ±0  4 270 ✅ ±0  243 💤 ±0  0 ❌ ±0 
  104 runs  ±0    104 ✅ ±0    0 💤 ±0  0 ❌ ±0 

Results for commit f872299. ± Comparison against base commit 892be33.

@akoch-yatta
Copy link
Contributor Author

This PR extends it to additionally provide the possibility to export a direct rendering on the GC

The snippet already prints an additional text when exporting to PDF so I'm not completely sure what is missing?

Yes, the text is there, but I would propose a set of more complex operations to be applied to showcase the usage

Also as we are painting to a canvas everything is already implicitly rendered through the GC anyways isn't it?

Still, there are differences, e.g. if I replace shell::print with canvas::print in the Snippet (to make it as similar as possible by directly applying the GC operations) the export looks different: background color + SWT.BORDER effect of the Canvas is shown when using canvas::print.

I mostly adapted to snippet to test the behavior with Windows, but I thought it makes sense to have a Snippet that utilizes both uses cases in a complex scenario.

@laeubi
Copy link
Contributor

laeubi commented Jan 6, 2026

Still, there are differences, e.g. if I replace shell::print with canvas::print in the Snippet (to make it as similar as possible by directly applying the GC operations) the export looks different: background color + SWT.BORDER effect of the Canvas is shown when using canvas::print.

Yes print will maybe print more of the controls parts. It was a bit clumsy as shell#print was not implemented in windows at all so there might me slight differences as well in when printing the canvas directly and when printing the whole shell.

@akoch-yatta
Copy link
Contributor Author

Still, there are differences, e.g. if I replace shell::print with canvas::print in the Snippet (to make it as similar as possible by directly applying the GC operations) the export looks different: background color + SWT.BORDER effect of the Canvas is shown when using canvas::print.

Yes print will maybe print more of the controls parts. It was a bit clumsy as shell#print was not implemented in windows at all so there might me slight differences as well in when printing the canvas directly and when printing the whole shell.

Which is fine in my opinion. I just wanted to give the option to check the export with both approaches.

At least in windows they provide very different results depending on zoom, autoscale mode and advanced mode setting of the GC. But that is a problem in Control#print most likely.

Currently Snippet388 showcases the PDF export by using Shell#print. This
commit extends it to additionally probide the possibility to export
a direct rendering on the GC.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Test Results

  176 files  ±0    176 suites  ±0   27m 14s ⏱️ - 1m 56s
4 676 tests ±0  4 654 ✅ ±0  22 💤 ±0  0 ❌ ±0 
  482 runs  ±0    476 ✅ ±0   6 💤 ±0  0 ❌ ±0 

Results for commit 7b630b9. ± Comparison against base commit bbb21e5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants