GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Struggling with the PDF Book Skin

Click to view RSS...
Author
Posted Friday, January 24, 2014 - Post #33058
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
Hi,
In my attempts to produce a PDF Book ready for printing using the PDF Book Skin, I am stuck with a few problems that I could not solve. I am looking for ideas (but would accept ready made solutions!) on how to make progress, solve or work around these problems.

Note: I did not test the Pedigree nor the Timeline functions as I do not currently plan to include them in this version of my reports.

Problem 1: Cut pictures
This is an identified problem mentioned in other recent threads of the PDF Book Skin. Did anybody find a solution to move the pictures or to avoid the pictures being cut?

http://support.genopro.com/Uploads/Images/8dbeffa6-b5e2-4fd0-a168-b9f2.jpg

Problem 2: Superscript does not always work (a minor detail)
In some places, the "superscript" referring to the footnotes is not superscripted. In my tests, it only happens with "1", never with subsequent superscripts ("2", "3", etc) and never when several superscripts are "together" ("1 2 3" e.g.)
As it happens not more than 3 or 4 times in my reports of 200 to 400 pages, I can live with it. Ron confirmed that it happens during the conversion from HTML to PDF in the "wkhtmltopdf.exe" program and cannot be corrected.

http://support.genopro.com/Uploads/Images/96c570d3-6151-4b3e-9217-8113.jpg

Problem 3: Bigger fonts (this is really the major problem).

Using the latest skin as is, I am able to produce reports with pages such as the "Cut pictures" page (see "Cut picture" page above), with font sizes much too small for my purpose. It is very difficult to read such pages printed in a landscape A4 format. I would not like to print the reports in a format bigger than A4 just to make the fonts legible.
I played around with changing almost every font size parameter in "theme.css" and "style.css". I could sometimes generate a report with bigger legible fonts, but then, the right margin would increase (see "Superscript" page above).


Problem 4: Change font color to "black" (probably the printer can do that).
I found the parameter "--grayscale" in the "wkhtmltopdf.exe" commands which changes the PDF report font color to gray. How can I change this to all characters being changed to black? I tried "--black" and --blackscale"...

Hoping that solutions exist which were just not within the reach of my limited technical qualifications. Thank you for your help. Kind regards.

Roland
Posted Saturday, February 1, 2014 - Post #33102
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 10 minutes ago
Posts: 3,339, Visits: 25,605
Hi Roland,

I believe have a partial solution with the attached style.css file.  Copy this into your Narrative Report skin overwriting existing file.  Run The Report using the Default theme (this is important).  This resolves the issue with print width in landscape mode, also font size and printing only in black.  The font size has been increased by 50% by line 24 of style.css i.e.  html{ font-size: 150%;}. You can of course change this value to suit.

So the superscript and split photo issues remain.  The authors of wkhtmltopdf have not provided any solution to these issues.  There is a possible circumvention to the split photos which I will experiment with as time permits.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Saturday, February 1, 2014 - Post #33103
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
Hi Ron,

Thank you for your help. I tested the new "style.css" file using the Default theme (2 of 11 in the Parameters Settings).

All characters in black works

With "font-size: 150%;", the Report Generator works and the result is getting closer to what I wish. The right margin is still a bit wide (5.5 cm).

With "font-size: 190%", which generates characters of a size that I prefer, the right margin widens to 7.5 cm, which is odd. Another funny behaviour: the pictures, although specified at the same size (430 x 430 for the larger pictures) in "Parameters Settings" shrink by approx. 10% (not a real problem for me; just surprising).

Another thing which could be nice to have: the titles should not be  left alone at the end of a page, separated from their paragraph which is on the following page. It would look better if the page jump happened before the title and the title is pushed down to the next page, on the top of its paragraph.

http://support.genopro.com/Uploads/Images/56581751-aa7f-41a8-90e0-3810.jpg

King regards

Roland
Posted Sunday, February 2, 2014 - Post #33106
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 10 minutes ago
Posts: 3,339, Visits: 25,605
I seem to get different result regarding page width, at least with the Harry Potter sample (see attached). Margins are as expected.  Perhaps you could also run it against HP and compare?

Can you confirm your hkhtmltopdf parameters from the Report Log? Mine are

Please wait... Executing command : "D:\Users\Public\Genopro\Skins\Narrative_2014.01.30\Code\wkhtmltopdf"-B 15mm -T 20mm -L 20mm -R 20mm -O Landscape --disable-external-links --page-size A4 --no-stop-slow-scripts --outline-depth 3 --encoding utf8      


Also can you export the registry key HKEY_CURRENT_USER\Software\DanMorin.com\GenoPro\SkinConfiguration\NarrativeReport\-- last used -- using regedit after running the report so that I can see your Config Params.

Mine looks like 

[HKEY_CURRENT_USER\Software\DanMorin.com\GenoPro\SkinConfiguration\NarrativeReport\-- last used --]
"Updated"="02 February 2014 17:44:44"
"PDFOrientation"="Landscape"
"PDFPageBreak"="FirstCharacter"
"ShowFlags"="AEKORSW"
"PDFHeader"=" "
"PDFFooter"=" "
"PageZoom"="150"
"PictureSizeLarge"="430x430"
"Book"="Y"
"PDFCover"="N"
"Timelines"="N"
"ConfigFlag"="OK"



'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


HarryPotter.pdf (717 views, 831.40 KB)
Posted Sunday, February 2, 2014 - Post #33107
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
My Harry Potter report (see attached) uses smaller fonts, the font-size in style.css does not seem to operate when I change from 150% or 190%, but the margins are now correct. Something must be different in my skin.

My wkhtmltopdf parameters:


http://support.genopro.com/Uploads/Images/075f7ba6-1af0-4832-8e47-05e1.JPG


My registry key


http://support.genopro.com/Uploads/Images/21988943-1af2-41bf-bce6-b448.JPG


I think I use PDF Book skin version 2013_12_20 with the latest style.css and my dictionary, but will start all over again to-morrow and generate a new skin with the latest english skin version, modified with the latest style.css version and my dictionary and let you know what happens.

Please tell me, based on above, if you think there is something else which I might be doing wrong.


HarryPotter.pdf (247 views, 540.74 KB)
Posted Tuesday, February 4, 2014 - Post #33122
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
Hi Ron,

I generated a new skin starting with Narrative Report Skin 2014.01.30 (EN).
I replaced style.css with the modified style.css attached in one of your earlier messages.
I replaced dictionary.xml with my custom dictionary tested and working with all recent skins
I used the "Default" theme (2/11)
I checked that wkhtmltopdf.exe was present in "Code" and its parameters were set to your default parameters

I used this skin in 2 configurations (one with font-size: 150%; one with font-size: 190%Wink to run the following genograms

Genogram Test Pitra is my small size test genogram generating a report of approximately 25 pages (depending on font-size value)
Genogram HarryPotter (HarryPotter.gno as supplied in SampleFiles) generating a report of approximately 120 pages
Genogram Schaeffer is a real genogram generating a report of approximately 250 pages
Genogram Suzor is a real genogram generating a report of approximately 420 pages

Each report was generated into its own, new (different name) folder.

The results are puzzling:

Test Pitra   150% version   font size as expected   right margin as expected (width similar to left margin)
Test Pitra   190% version   font size as expected   right margin as expected
HarryPotter  150% version   font size as expected   right margin as expected
HarryPotter  190% version   font size as expected   right margin as expected
Schaeffer  150% version   font size smaller than expected (smaller than the size in above test runs)   right margin wider than expected (~ 5 cm)
Schaeffer  190% version   font size smaller than expected (but slightly bigger than previous 150% report)   right margin wider than expected (~ ~ 7 cm; wider than previous 150% version)
Suzor 150% version   font size as expected   right margin as expected
Suzor 190% version   font size as expected   right margin as expected

Obviously, there is a problem with the narrative report generated using the Schaeffer genogram, but I can't figure out what is different. I used the same skin, the same parameters.

Suzor genogram (font-size: 190%)

http://support.genopro.com/Uploads/Images/6118543f-1549-4b8b-882f-7d80.JPG



Schaeffer genogram (font-size: 190%)

http://support.genopro.com/Uploads/Images/df89a25c-0c2f-4e2d-b583-899f.JPG

I just sent you the corresponding genograms by PM. Thank you for your help. Kind regards

Roland


Edited: Tuesday, February 4, 2014 by desny
Posted Tuesday, February 4, 2014 - Post #33126
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 10 minutes ago
Posts: 3,339, Visits: 25,605
Hi Roland, I haven't received any PM today, so perhaps there is a problem with the GenoPro Forum server.

I have seen an issue reported with hkhtmltopdf where the font gets reduced.  Apparently this can occur if CSS styling to avoid page breaks is used and the resulting content is too big for a page.  I did use this type of styling to try and overcome the split photo problem but obviously this is not working anyway.  

So perhaps try removing the line .avoidbreak {page-break-inside: avoid;} (line 92) from style.css.  I can't really see how this is causing the problem you have so it is a 'shot in the dark' so to speak but worth a try.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Wednesday, February 5, 2014 - Post #33132
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
Hi Ron,

Removing .avoidbreak {page-break-inside: avoid;} (line 92) from style.css does not show anything different in the Schaeffer PDF report
Adding  --disable-smart-shrinking in "other wkhtmltopdf parameters" field of Config Params generates Schaeffer reports with the correct font size, but the right margins remains too wide, as it was in previous tests
Installing IrfanView generates Schaeffer reports with some photographs missing (empty boxes)
Unticking "Create thumbnail images" generates a Schaeffer report with all the photographs replaced with empty boxes

Kind regards

Roland
Posted Thursday, February 6, 2014 - Post #33135
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 10 minutes ago
Posts: 3,339, Visits: 25,605
Hi Roland.

 I am very surprised that you have missing pictures when using IrfanView thumbnails and I would like to understand why this is happening.  Perhaps you could kindly answer the following:

  1. Did you see any errors in the Report Log when thumbnails were being created?
  2. Do the missing images in fact have thumbnail images in the thumbnails folder of the report drestination folder?
  3. Are the images also missing when you open individuals.htm from the destination folder in a browser?
  4. Is the margin problem still there when PDF produced with IrfanView thumbnails?


Perhaps it is also time to take stock of where we are with PDF output.

  • The problem of pictures split between pages appears to be unavoidable unless wkhtmltopdf is improved.
  • There are unknown factors within wkhtmltopdf causing font reduction at times.
  • I have discovered that both IE8+ and Firefox will print the individuals.htm file without splitting the larger right-hand pictures but sometimes the smaller images on the left are truncated.  IE9+ is required to ensure the CSS media print styles to provide all black text works correctly. Only IE8 is available for XP. 
  •   Printing with Google Chrome does still lead to split images.


I therefore suggest the way forward when the  Table of Contents, or TOC, feature of wkhtmltopdf is not required is to print individuals.htm via Firefox to a PDF printer package (e.g. CutePDF, PrimoPDF etc. ).

Over the next day or so I will amend the Narrative Report skin to incorporate the things discovered whilst working with Roland on this issue over the past  days and provide an option to produce individuals.htm but not run wkhtmltopdf to produce PDF directly, leaving it up to the user to convert as above.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Thursday, February 6, 2014 - Post #33142
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Customers
GenoPro version: 2.5.3.9

Last Login: Tuesday, August 20, 2019
Posts: 104, Visits: 1,686
Hi Ron,

1. No errors in the report log. All the pictures of the report were generated (updated) as thumbnails, including those which are "behind the top of the pile" picture in the same box (the ones which are scrolled in this box in the HTML report). This leads me to think that the problem could be linked with a memory shortage, the way some pictures are swapped out because of a lack of memory in the Photo album of the HTML report.

The missing picture problem appears under different expressions:

1.1. Blank page (no text, an empty box frame for the missing picture, but the box is the size and aspect ratio of the missing picture)


1.2. Hybrid (mix of picture and empty box on the same page; all text missing)

http://support.genopro.com/Uploads/Images/5d691c5b-b1af-430b-911b-3d6a.JPG


1.3 Funny picture in 3 small partial iterations. The following page is a "missing picture with empty box and no text" version.

http://support.genopro.com/Uploads/Images/2aca98d0-0ecb-4196-ae10-92fb.JPG


After an empty page, the report goes on as if nothing had happened. In particular, the following page starts where it should have started if there had been the "normal" previous page.

 
2. All the pictures including the missing pictures have thumbnail images in the thumbnails folder of the report destination folder.

3. All the pictures including the missing pictures are there when I open individuals.htm from the destination folder in a browser

4. The margin problem is still there when the PDF report is produced with IrfanView thumbnails. Please note that it is also present in the individuals.htm file, but it is possible to correct this in the HTML to PDF conversion program.

I shall start playing with the "individuals.htm" file and converting it to a PDF report. This could be a solution for me

Kind regards

Roland


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse