LPub3D - Request - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html) +--- Thread: LPub3D - Request (/thread-21919.html) |
LPub3D - Request - Kevin - 2016-11-22 Trevor, When printing to a PDF file, would it be possible to make the background color/image a background layer in PDF that could be suppressed when actually printing a hardcopy? Also, I recently noticed that when using the A4 page size in landscape mode, there was a thin white band at the right edge of the generated PDF pages. This band went away when I chose a Custom page size of 8.27 x 11.7 inches instead of LPub3D's default of 8.3 x 11.7 for A4. Thanks! Kevin RE: LPub3D - Request - Merlijn Wissink - 2016-11-23 I think I saw that tiny white band on landscape pages too, I thought my image was too small or something. But because I went for white pages backgrounds in the end anyway, I didn't take a closer look at it. RE: LPub3D - Request - Trevor Sandy - 2016-11-24 (2016-11-22, 16:43)Kevin Wrote: When printing to a PDF file, would it be possible to make the background color/image a background layer in PDF that could be suppressed when actually printing a hardcopy? Kevin, It is possible to suppress the document background (set to transparent at printing). However, I'm not sure I well understand how you expect to print a pdf hardcopy. At this moment, it is not possible to print a hardcopy directly from LPub3D - this is by design, actually the code is already in place, I have just not enabled it. Considering the current status of LPub3D, are you suggesting to print a hardcopy from a third party application (e.g. Acrobat or Acrobat Reader...) ? If yes, I'm not sure how I can force a third party application to suppress printing the background. However, Acrobat does offer the ability to remove the background of your pdf document. Perhaps this can be a workable solution to your request if you expect to print from a third party application. With LPub3D, I can offer to suppress the background as an option when exporting to pdf - or any output for that matter. Let me know if what you envision is different from what I have described here ? (2016-11-22, 16:43)Kevin Wrote: I recently noticed that when using the A4 page size in landscape mode, there was a thin white band at the right edge of the generated PDF pages. This band went away when I chose a Custom page size of 8.27 x 11.7 inches instead of LPub3D's default of 8.3 x 11.7 for A4. Indeed, this is a known issue coming from LPub. Despite my efforts, I have not been able to completely solve it. Kevin Clague best summarizes the issue in his code comment: /* There are issues with printing to PDF and its fixed page sizes, and * LPub's arbitrary page size controls. So when printing, we have to * pick a PDF page size that is closest but not smaller than the size * defined by the user, and then fill that page's background to the * edges. The code below gets most of this done (the print caller * maps LPub page size to PDF page size and sets view size, so we * work with that here. * * There still seem to be cases where we get little gaps on either the * right or bottom edge, and I just don't know what the problem is. */ I think it is linked to the conversion between pixels, mm and in - inches are exclusively used by the print engine to get the right DPI value. Cheers, RE: LPub3D - Request - Kevin - 2016-11-24 Trevor, Thanks for the response. Yes, I'm talking about printing from a 3rd-party application after the PDF has been generated. If the PDF document generated by LPub3D identifies the background (color, image, gradient) as a background layer, then Acrobat Reader (and probably other apps) can suppress printing it. The actual content of the page would be in another layer. I tried setting the background to "transparent" but it appears that LPub3D generates a white background for the PDF document. When I tried to add a background layer using another product (PDFedit995) after generating the PDF, I could tell that the layer was there, but it was completely obscured by the LPub3D content and its white background. As for the white band when using the default of A4, I think it may have to do with an incorrect setting within LPub3D. The correct size in inches is 8.2677 x 11.6929. If LPub3D is actually rounding this size to 8.3 x 11.7, then my guess is that the page is being shrunk to fit the actual A4 format. Since the short edge is "more bigger" than A4 than the long edge is, the resulting shrunk page is shorter than 11.6929, resulting in white space. LPub3D can display the page size to 4 digits of precision. I'm hoping that the default sizes are stored the same way. In which case, all it may take is a correction of the default size(s). Kevin RE: LPub3D - Request - Trevor Sandy - 2016-11-24 (2016-11-24, 14:49)Kevin Wrote: I tried setting the background to "transparent" but it appears that LPub3D generates a white background for the PDF document. You are right. I use white (with alpha = 1) to get a 'fake' transparent. I do this because If I actually set the background to transparent, it is interpreted by Qt as no background. No background is not good because all components (assy, pli, step number, context menus etc...) are placed via the background so if no background, the generated page will be completely blank. Placing things via the background is an LPub pattern. A rewrite would be overwhelming. (2016-11-24, 14:49)Kevin Wrote: As for the white band when using the default of A4, I think it may have to do with an incorrect setting within LPub3D. The correct size in inches is 8.2677 x 11.6929. If LPub3D is actually rounding this size to 8.3 x 11.7, then my guess is that the page is being shrunk to fit the actual A4 format. Since the short edge is "more bigger" than A4 than the long edge is, the resulting shrunk page is shorter than 11.6929, resulting in white space. Ah, you may be right. I use the page size settings from this site which rounds to the 10ths as you indicate. If you know of a better source where I can get all the sizes with 4 decimal places that would be great. I would set all the page sizes accordingly. Here is the static table I currently use: Code: // page sizes in centimeters and inches RE: LPub3D - Request - Kevin - 2016-11-24 Code: // page sizes in centimeters and inches RE: LPub3D - Request - Trevor Sandy - 2016-11-24 Many thanks Kevin !! - I updated the parms and indeed, the line no longer appear on A4, Letter or the other page sizes I tested. I've been chasing this issue for some time. Thanks to you, I think it's now addressed. Cheers, RE: LPub3D - Request - Kevin - 2016-11-25 Happy to help. I edited the previous response to remove the extra commas. Kevin RE: LPub3D - Request - Trevor Sandy - 2016-11-25 Kevin - I took another look at the transparent background behaviour. With true transparent (brushColor = Qt::transparent), I am able to get the page to present most of the page components. However, I can not get the page background context menu to present so I've devised some work around logic. Basically, if the page background is set to none(transparent) by the user, i'll set the page white with alpha=1 during page editing and switch to true transparent for exporting/printing. This way, the user will have the ability to manipulate the page components while editing the document. This work around is not difficult so look for it in the next release. Update: Implemented and tested. Cheers, RE: LPub3D - Request - Kevin - 2016-11-25 (2016-11-25, 3:34)Trevor Sandy Wrote: Kevin - I took another look at the transparent background behaviour. With true transparent (brushColor = Qt::transparent), I am able to get the page to present most of the page components. However, I can not get the page background context menu to present so I've devised some work around logic. Awesome! you rock! Thanks once again. Kevin RE: LPub3D - Request - Merlijn Wissink - 2016-11-25 (2016-11-25, 3:34)Trevor Sandy Wrote: Kevin - I took another look at the transparent background behaviour. With true transparent (brushColor = Qt::transparent), I am able to get the page to present most of the page components. However, I can not get the page background context menu to present so I've devised some work around logic. Wasn't that the same 'problem/annoyance' I mentioned earlier this week/last week? I believe so, great to hear you fixed that! Thanks! RE: LPub3D - Request - Trevor Sandy - 2016-11-25 (2016-11-25, 8:14)Merlijn Wissink Wrote: Wasn't that the same 'problem/annoyance' I mentioned earlier this week/last week? Indeed. Cheers, |