Print at Dec 18, 2025, 7:40:50 PM

Posted by AlexDeveloper at Apr 11, 2024, 11:55:28 PM
smile   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())) {

float var19 = var18.getStartPointToEndPointDistance();
String var20 = this.preferences.getLengthUnit().getFormat().format(var19);
AttributedString var21 = new AttributedString(var20);
var21.addAttribute(TextAttribute.BACKGROUND, Color.WHITE);
var21.addAttribute(TextAttribute.FONT, var16);
AffineTransform var22 = g2D.getTransform();
double var23 = Math.atan2((double) (var18.getYEnd() - var18.getYStart()), (double) (var18.getXEnd() - var18.getXStart()));
boolean var25 = var23 < -1.5707963267948966 || var23 > 1.5707963267948966;
if (var25) {
g2D.translate((double) var18.getXEnd(), (double) var18.getYEnd());
g2D.rotate(Math.PI + var23);
} else {
g2D.translate((double) var18.getXStart(), (double) var18.getYStart());
g2D.rotate(var23);
}

FontMetrics var26 = this.getFontMetrics(var16, var29);
Rectangle2D var27 = var26.getStringBounds(var20, g2D);
g2D.translate((double) ((var19 - (float) var27.getWidth()) / 2.0F), (double) ((float) var27.getHeight() / 2.0F));
g2D.drawString(var21.getIterator(), 0, 0);
g2D.setTransform(var22);
}
}


Thank you very much for your help!! smile smile smile smile