PDF font and img size

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

PDF font and img size

Unread post by Alex Luna »

Hello,

I publish my help project to webhelp and PDF.
I use std font size 11 for topic content. That size is OK for webhelp, but too large for PDF. How can I change the font to be smaller only in PDF topic content?

Also, I have images 145 x 145 pixels inside topic contents. Similar to font size problem, images are rendered well in webhelp but are too large in PDF. How can I make them smaller for PDF topic content?

Thank you
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: PDF font and img size

Unread post by John Johann »

If you are using styles, you can define one size for on-screen and another for PDF.
You can find info here:
https://www.helpandmanual.com/help/hm_w ... print.html

Image sizes can be set dynamically to the container they are in or you can insert conditions and a further version of the image in a different size according to the output.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: PDF font and img size

Unread post by Tim Green »

Also, I have images 145 x 145 pixels inside topic contents. Similar to font size problem, images are rendered well in webhelp but are too large in PDF. How can I make them smaller for PDF topic content?
An image of that size is really tiny and in a high-resolution format like PDF you will most likely get quality problems. It would be better to use a much larger image and scale it in the HM editor (double-click on the image to access the insertion dialog and set the sizing). Then HM will export the full original image to PDF with a scaling command, which will result in better quality display.

Generally it is best to use the responsive image scaling setting, which is "% of page width, maximum is physical width". This will adjust the image to the format in which it is being displayed, including PDF. It also works best with the use of larger images, as explained above. Also note that when you insert the image in a table the width is the % of the table cell width, not of the entire page.

Another important point is that in PDF HM will always try to save your layout from being broken. So if you specify an image size that would break the layout, HM will first reduce the size of the image in an attempt to save the layout.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Hello Tim,

Thank you for the styles tip, I got the results I expected.

Regarding the images, the problem is with links with images.

I got some pages with 5-columns table, each cell has 20% width assigned, and content like this:

Code: Select all

<td style="width:20%;">
    <para styleclass="Body Text Tabla" style="text-align:center;"><link displaytype="image" src="cmi.png" type="topiclink" href="Cuadro-de-Mando"></link></para>
</td>
All the images used area 145px x 145 px and they are displayed at an acceptable width both in web and pdf formats.
The problem with those images in PDF is that they are printed one over the other. A attach some captures to explain it better.

How can I get the PDF printed similar to webhelp?

Thank you
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: PDF font and img size

Unread post by Tim Green »

How can I get the PDF printed similar to webhelp?
This is happening because your layout does not fit between the margins on the PDF page. It can also happen if the images you are inserting in the table cells are larger than the table cells. It can also be a combination of these two things. In WebHelp there are no page margins -- the page can be as wide and as high as its content, there are no limits there.

A PDF is a printed page stored in a file. It has all the same restrictions as a printed page: Most importantly, fixed width that cannot be changed, defined by the paper size and the margins. If the layout you define doesn't fit on the page, Help+Manual will try to make it fit. If it is a table then HM will make all the columns adjustble width and will adjust the sizes of any images in the columns until everything fits on the page. It will "fit", but the results most likely won't be what you want.

When including fixed-width elements like tables in PDF you need to plan carefully to fit them between the margins of the page. Otherwise you will get what you show in your screenshots above. This is particularly important in tables like the one in your example, because you have images in EVERY column. Since images are fixed width, this means you cannot have any flexible columns that can easily be adjusted to make the table fit. All the columns must be fixed width, so if your table doesn't fit it will break the layout and you will get the results you show in your example.

See this topic in the help to learn how to make tables fit with adjustable-width columns:

https://www.helpandmanual.com/help/hm_w ... idths.html
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Hello Tim,

I'm using A4 (21 x 29.7) page size, margins are set to 1.5, that leaves 18 cm for topic contents. Table has no specific width, it can be sized to fit page, table cells have 4 px padding, 0 px border and 0 px spacing. So I think the total table width should be 765 (145px x 5 + 4px x 10).

Then, it all depends on the resolution used to render the page. If 72 ppi res is used, the table needs to be shrinked, but if 150 ppi res is used, the table will fit.

So, how can I change the resolution used to render PDF?

Thank you
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: PDF font and img size

Unread post by Martin Wynne »

Alex Luna wrote: Tue Feb 02, 2021 4:18 pm So, how can I change the resolution used to render PDF?
Hi Alex,

In the Program Options, change the PDF reference device.

Then set the required DPI for the chosen device in its Properties settings.

hm_pdf_ref.png

cheers,

Martin.
You do not have the required permissions to view the files attached to this post.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Hello Martin,

My Program Options are set to use screen as reference device. My screen is Full HD.

Anyway, I've changed to use my Adobde PDF virtual printer as reference device, it has a resolution of 600 PPI.

Then Publish to PDF, and got exactly the same results: images are overlapped.

Any hint?
Thanks
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: PDF font and img size

Unread post by Martin Wynne »

Alex Luna wrote: Tue Feb 02, 2021 5:55 pm I've changed to use my Adobde PDF virtual printer
Hi Alex,

If you want to use a PDF virtual printer, you need to Print your project, not Publish it.

hm_print.png

Select the virtual printer as the printer to be used.

cheers,

Martin.
You do not have the required permissions to view the files attached to this post.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Hi Martin,

This is getting confusing.

I want to publish my project to PDF format, and I'm not getting the output correctly.

You suggested to change Program Options to set PDF Export to a differen reference device, as a way to change the ppi resolution used to pubish to PDF.
I was uysing screen as reference deveice, and my screen has 1920 x 1080, more than the 150 ppi needed to correctly render the PDF.

Then I did what you say, and changed my reference device to a virtual printer with 600 ppi, then published to PDF and got the same undesired result.

Any hint?
Thank you
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: PDF font and img size

Unread post by Martin Wynne »

Alex Luna wrote: Tue Feb 02, 2021 9:32 pmI was using screen as reference device, and my screen has 1920 x 1080, more than the 150 ppi needed to correctly render the PDF.
Hi Alex,

If your screen is 1920x1080 it is very likely set to 120 DPI (125%). Not 150 DPI (dots per inch).

If you use a PDF virtual printer as the reference device, you will be conflicting with the built-in H&M PDF virtual printer.

You need to set an ordinary printer as the reference device. You don't need the actual physical printer, you can simply install the driver for it.

By default it will normally print at 300 DPI, but you can set the printing preferences to best quality or whatever gets you 600 DPI if you prefer. Also set suitable page margins, your screenshot has a very wide left margin.

I don't know what settings you have used on the images in H&M, so I can't advise much further -- this is the drop-down setting most folks use:

hm_img_sizing.png

(Note that the word "physical" there is misleading -- digital images don't have a physical size. It should say "native size".)

No doubt Tim will be along soon to help with the PDF template settings.

cheers,

Martin.
You do not have the required permissions to view the files attached to this post.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Hi Martin,

Thanks for your promptly and detailed response.

I've changed PDF Export options to a laser printer, 600x600 dpi. The output is exactly the same, those images in PDF are still overlapped.
No matter which printer driver I choose, or if I set screen as the reference device, the PDF is rendered exactly the same.

The left and right margins in my PDF template are set to 1.5.

The images inside table cells are links:

Code: Select all

<link displaytype="image" src="cmi.png" type="topiclink" href="Cuadro-de-Mando"></link>
When I double-click on the image, I got the Edit Hyperlink dialog. And here resides the problem.

It seems HM doesn't support scaling attribute to link tag, even with displaytype set to image. If you refer to img3.jpg I attached in a previous post, you'll see that the last image (help sign) is smaller than the other ones, that's because that image isn't a hyperlink, and has the scalling attribute to 100%.

So, how can I have images with links and set its scaling to 100%? I've tried to enclose an <image> tag inside a <link> tag without success.

Regards
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: PDF font and img size

Unread post by Martin Wynne »

Hi Alex,

You can't have clickable images in a PDF, the PDF format is designed to be printed. Clicking things is for the Webhelp format.

You need to use the Conditional Text functions in H&M, so that in Webhelp you have the images as topic links, and in the PDF they are plain images.

cheers,

Martin.
Alex Luna
Posts: 10
Joined: Fri Jan 18, 2019 4:33 am

Re: PDF font and img size

Unread post by Alex Luna »

Thank you Martin, solved with conditional text to remove links on images for PDF output.
Regards
Post Reply