Joined: Mar 18, 2024
Post Count: 10
Status:
Offline
Generate PDF file.
Hello, I am appealing to this developer audience with a problem that I have faced.
I have made some changes to the drawing wall. Changes are labeled on the center of each wall and show the length of the wall (see video - link ). My problem is that when I want to export the plan in a PDF file white labels that are on the center of each wall do not export in PDF and I see just black walls without white labels (see vide - link).
But when I use a plugin "Export plan to PNG" everything works correctly (see screenshot - link ).
here is a code changes in the method paintWalls - link brief code:
for (Wall var18 : var13) { if (home.wallType.contains(var18.getModeCreationName())) {
Joined: May 18, 2021
Post Count: 254
Status:
Offline
Re: Generate PDF file.
I'm curious, does exporting to SVG correctly show your wall labels?
There's a PaintMode (PAINT, PRINT, CLIPBOARD, EXPORT) which is selecting different bits of code in the PlanComponent.java file depending on if you are painting to screen, printing, exporting to SVG, or copying to clipboard. The answer might lie in that code.
Italy
Joined: Apr 12, 2019
Post Count: 55
Status:
Offline
Re: Generate PDF file.
Good morning I read your trend's email. I am not a programmer, but I can say that I fully agree with Sib007, given that PDFs (Portable Document Files) are by their constructive and historical characteristic an evolution of the Postscript PRINT language (also from Adobe), both logical and any autonomous source of Building a PDF file actually uses PRINT instructions
Italy
Joined: Nov 17, 2021
Post Count: 460
Status:
Offline
Re: Generate PDF file.
Are you REALLY sure that labels aren't painted? It could be that in PDF they are drawn by default using transparent background, so the text cannot be seen. Try to select the text in the exported PDF, if the labels are there, then you should see the text highlighted. If this is so, then you could simply set the background color; if background color isn't an available feature, just draw a rectangle before drawing the text.
Just courious: why in the world are these variables called this way? Have you used a decompiler to get the source code? You should know that this is an open source software, so you can get the original sources.
France
Joined: Nov 7, 2005
Post Count: 9421
Status:
Offline
Re: Generate PDF file.
First thing, if you want some help, you have to help programmers understanding your code too. Naming every variable varsomething is really troublesome and in the long term, it won't help your code maintenance. Some comments could be welcomed too, at least to show where you made some modifications.
Then, in your code:
if (home.wallType.contains(var18.getModeCreationName())) {
wallType and getModeCreationName are new field and method you introduced in your derived version. Are you sure that this condition is fulfilled? Did you use a debugger to check how it works? Did you try to print, instead of printing to PDF? Then, try to print through a PDF printer driver?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator