[Html2PdfConverter] Problem trying to create a single label

[Html2PdfConverter] Problem trying to create a single label

  
Forge Component
(40)
Published on 24 Mar by Guilherme Pereira
40 votes
Published on 24 Mar by Guilherme Pereira
Hi,

I'm trying to use this component to create a pdf file for a single 50mm x 12 mm label from a web screen in my OS application.

The converter calls a url in my app that has very basic page, it ouputs the pdf in the correct size but wants to print 4 labels with partial text shown in the top section of the label only (see attached).

I've played around with all sorts of css and layouts to try and get the height of that line increased to no avail.

The GeneratePDF call has call has no proxy & the following options (OtherArgs): " -O Landscape -T 1 -L 1 --page-width 12mm --page-height 50mm --disable-smart-shrinking --zoom 3.0" (the last couple of options were added after reading some posts in the wkhtmltopdf issue manager in an attempt to find a solution).

The page to be converted is based on a Layout web block I created. It has a MainContent placeholder and some simple css


.MainLabel {
    background: #fff;
    vertical-align: center;
}

The Webscreen has a one row/cell ShowRecord to display the data for the label. css...

body { background: #fff; width: 300px; } .ShowLabel tr { border-bottom: none; white-space: nowrap; text-align: center; } .ShowLabel_Caption { color: Black; font-size: xx-small; } .ShowLabel_Value { color: Black; font-size: xx-small;
}

If anyone could shed some light on the issue I'd be very grateful.

Cheers,
Gavin


Hello Gavin,

Can you show the URL you're passing and the screen permissions?
Try also the screen in more than one browser versions to check some CSS incompatibilities between browsers and it's versions.
Try also to convert it by removing some args at ecah time, because the problem can be there.

Kind Regards,
GM
Hi GM,

>>Try also to convert it by removing some args at ecah time, because the problem can be there.

I think I'd been looking at it without a break for too long.  Taking away the page size args showed it printed in full on an A4 page and then it twigged. It was the bottom margin which I wasn't setting and defaults to 10mm (which is most of the label).  Set the bottom margin to 1mm and like magic it printed on the bottom part of the label :)

Thanks for your help.

Cheers,
Gavin