Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Font formatting is lost when converting html to pdf

Community Beginner ,
Nov 15, 2016 Nov 15, 2016

After each election I get a set of html files that contain election reports generated by third party voting software.

The html files are wrapped in <html><pre> tags so the files display correctly with a fixed width font, ie Courier.

When I use Acrobat DC to convert the html file to pdf, Acrobat substitutes a Times New Roman font, ignoring the <pre> tag.

With the variable width font, the <pre> report formatting is lost, the columns don't line up.

I've tried inserting an inline style statement for font-family:courier, but that is ignored by Acrobat DC.

Correct report format

http://sussexcountyclerk.org/docs/elections/2016/20161108-Official/ANDOVER-BORO.html

Incorrect report format from Acrobat DC

http://sussexcountyclerk.org/docs/elections/2016/20161108-Official/ANDOVER-BORO.pdf

How can I convert html files to pdf from within Acrobat DC without losing the report formatting?

I don't mean print to pdf, I mean convert to pdf from inside Acrobat DC.

Update: The same behavior occurs when converting a plain txt file, fixed width formatting is lost.

TOPICS
Create PDFs
8.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 15, 2016 Nov 15, 2016

Hello,

I will look into this further.

As a workaround try to print the file to PDF printer to get it converted to PDF.

Let us know if that helps.

Regards,
Tariq Dar.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2016 Nov 16, 2016

Print to Adobe PDF creates a correctly formatted searchable PDF in IE11 and FF48.  Print to Adobe PDF in Chrome 54 creates a correctly formatted, non-searchable image.  All these approaches are workarounds to using Acrobat natively.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 16, 2016 Nov 16, 2016

Thank you for confirming.

Also, would like to review this issue further using some of your resource files.

Is it possible for you to share those or some sample HTML files, using which you are able to reproduce the behaviour?

If you can, you may use GoogleDrive or Adobe Send or DropBox to share those files with us.

- Tariq Dar.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2016 Nov 16, 2016

Here are links to a txt file and an html file.  Download them, then, from inside Acrobat, create PDF from file.

https://drive.google.com/file/d/0B-uAza53CpkIRnhrMkY1b1VETHM/view?usp=sharing

https://drive.google.com/file/d/0B-uAza53CpkIbmdNeEpGaDBNRXc/view?usp=sharing

Note, you must manually set the page layout to landscape so the print lines don't wrap.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 28, 2017 Nov 28, 2017

This is still a problem.  Cannot create a report in fixed width font from a text/html file.

The link points to shared Google Docs containing the original html file, two pdf result samples, and a screen shot of the conversion settings specifying Courier font.

https://drive.google.com/open?id=1sBSPHHHDCWPQPk-1gZ-M1gJXY0aTb6v4

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2016 Nov 16, 2016

You can change the default font for HTML conversions, which is also used for TXT. While not a solution if you want mixed fonts, it might work for you. The trick is to go to convert a web page to PDF, and change the conversion settings. These settings are then applied to HTML and TXT conversion.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2016 Nov 16, 2016

I did try to do that, perhaps I looked in the wrong place.

In Acrobat I chose Edit->Preferences->Convert To PDF->HTML

The message displayed is "There are no settings that can be edited in HTML" and the Edit Settings... button is grayed out.

Is there another place to change the default font for HTML files?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2016 Nov 16, 2016

The settings are not in a logical place so you need to follow my directions: go to convert a web page (NOT an HTML document) to PDF. To put it another way, go to create a PDF from web page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2016 Nov 16, 2016

I tried that but my font settings were ignored.  Here's what I did, from inside Acrobat DC:

File->Create->PDF from Web Page

Browse to HTML file

File Type: HTML

Click Settings

Body Text: Courier New (no other settings changed)

OK

Uncheck all PDF Settings

OK

Create

Resulting PDF is still proportional font, Times New Roman

I followed the above steps using a txt file as input, same result.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 28, 2017 Nov 28, 2017

I tried your file from an older version of Acrobat, and it converted the < PRE > section to CourierNewPSMT without even being asked. You may have a new bug. (Not very new, of course) What is your exact version of Acrobat DC?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 28, 2017 Nov 28, 2017

Adobe Acrobat Pro DC

Continuous Release | Version 2018.009.20044

"No updates available"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 05, 2019 Jun 05, 2019
LATEST

June 5, 2019.  This is still a problem this morning, the day after our primary election.

Adobe Acrobat DC 19.012.20034

No updates available.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines