Pdf from Draft Block export doesn't work as expected

MacOs 12.6.6 Seamly2d 2023.6.12.206

png export of Draft Block works fine, pdf export only exports part of the blocks, see below:

png:

pdf: 2023-06-11_T-shirt-Aldritch-fitted_block.pdf (17.4 KB)

Export Pieces works fine

2 Likes

Yeah, that’s annoying. If I recall, exporting from Piece used to do the same thing, in which case it is fixable. Otherwise, the PDF reader only shows the part which is to the lower right (positive space) of the zero point of the grid.

Workarounds:

  • All the information is there, if you open it in inkscape, or probably any vector drawing application, you will see it.
  • Move your base point(s) so that the entire draft is in the positive space to the lower right of the zero point.

I hope that is of some use to you. Happy drafting!

:unicorn:

1 Like

thanks a lot, Piece exporting works fine, but I’ll keep in mind the workarounds in case I want to export the draft blocks.

2 Likes

Hmmm… that’s odd or interesting depending on how you look at it. :slight_smile:

I’ll look at the export code see if I can figure out why the reader is only showing the positive 1/2.

1 Like

I looked at the code and I think I know what the issue is. In the call to the scene->render() it calls for a source and target rect(). Which currently both are the same scene rect(). The source scene rect() is the bounding box of all the items on the scene - which of course can be in scene coordinates with negative values. We want the target rect() to be in rect coordinates. Take an example of a rect of (-10, -10) to (10, 10) in scene coordinates… the target needs to be (0,0) to (20, 20) in rect coordinates… otherwise the pdf reader only wants to display a rect (0,0) to (10,10),

2 Likes

Fixed. In more ways than 1. It now displays the whole target rect(). I also changed the aspectRatioMode from QT::IgnoreAspectRatio (Which will scale both width and height to fit the target rect() - no bueno) to Qt::KeepAspectRatio which will keep the size scaled to a rectangle as large as possible inside the target rectangle, preserving the aspect ratio.

qimage-scaling

4_pocket_vest_block.pdf (25.1 KB)

2 Likes