Closed chharms closed 3 years ago
Can you check this version https://github.com/rbodziony/mcf2pdf/releases/tag/0.3.6 with enabled debug and provide log?
Hello, I ran the new version 0.3.6. This time, the 2017 book was generated fine, just some (handled) exceptions. The 2018 book fails now at a later stage (which I did not reach before). I consider the initial issue as solved. Just for information: the newly observed error is caused by a clipart item. After removing that clipart, also the 2018 book can be generated.
For completeness I like to add the 2018 logfile, but "Something went really wrong, and we can’t process that file."
Ok can you share part of 2018 book which contains this clipart?
Yes, here is the page description:
`
23.0.07.: Cap Fréhel |
360° ↓ |
You removed this ... <area areatype="clipartarea" width="170.3823206431....?
Yes, I removed the clipart and error was gone. The actual error was:
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Unknown Source)
at java.base/java.util.regex.Matcher.reset(Unknown Source)
at java.base/java.util.regex.Matcher.<init>(Unknown Source)
at java.base/java.util.regex.Pattern.matcher(Unknown Source)
at net.sf.mcf2pdf.pagebuild.PageRenderContext.getClipart(PageRenderContext.java:126)
at net.sf.mcf2pdf.pagebuild.PageClipart.renderAsBitmap(PageClipart.java:51)
at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(BitmapPageBuilder.java:75)
at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:253)
at net.sf.mcf2pdf.Main.main(Main.java:202)
Ok so issue was because mcf2pdf expected that clipart has name and this didn't haven have you got more this kind of cliparts in your .mcf files?
Rarely. In the 2018 book I had two cliparts.
Edit: In the meantime I checked also with 0.3.8 of bodziony (which loads the resources for the backgrounds but still reports them as missing). But I see there's already some bug filed for 6.4.3 so I'll just wait and see. Thank you.
Original post: I encountered this error when trying to render a new Photobook with the Pixum CEWE Software. (Pixum Fotowelt 6.4.3 of 16.04.2019) with the 0.3.7, 0.3.8 (bodziony) version (with 0.3.4 as well).
...
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Checking XML file for product catalogue: C:\Program Files\Pixum\Pixum Fotowelt\Resources\products\TS102.xml
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Adding product catalogue found in C:\Program Files\Pixum\Pixum Fotowelt\Resources\products\TS102.xml
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Searching for MCF resources in [C:\Program Files\Pixum\Pixum Fotowelt\Resources, C:\ProgramData\tmp, C:\ProgramData\hps]
[DEBUG] net.sf.mcf2pdf.mcfglobals.McfResourceScanner Processing default backgrounds C:\Program Files\Pixum\Pixum Fotowelt\Resources\photofun\categories\backgrounds_default.xml
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Reading MCF file
[DEBUG] net.sf.mcf2pdf.Mcf2FoConverter Preparing temporary working directory
[INFO ] net.sf.mcf2pdf.Mcf2FoConverter Rendering cover...
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText processing html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Calibri'; font-size:16pt; font-weight:400; font-style:normal;"><table style="-qt-table-type: root; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;"><tr><td style="border: none;"><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;">England & Wales</span></p><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;"> 2019</span></p></td></tr></table></body></html>
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText body =<body style=" font-family:'Calibri'; font-size:16pt; font-weight:400; font-style:normal;">
<table style="-qt-table-type: root; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;">
<tbody>
<tr>
<td style="border: none;"><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;">England & Wales</span></p><p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;"> 2019</span></p></td>
</tr>
</tbody>
</table>
</body>
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText tablestyle=-qt-table-type: root; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText p =<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;">England & Wales</span></p>
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText p.tagname =p
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText para =net.sf.mcf2pdf.pagebuild.FormattedTextParagraph@136aa0c
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText p =<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bookman Old Style'; font-size:48pt; font-weight:600; color:#ffffff;"> 2019</span></p>
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText p.tagname =p
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText para =net.sf.mcf2pdf.pagebuild.FormattedTextParagraph@df8434
[DEBUG] net.sf.mcf2pdf.pagebuild.BitmapPageBuilder Creating full page image from page elements
[WARN ] net.sf.mcf2pdf.pagebuild.PageBackground Background not found for page 0: kraeftige_farben_cover_back_portrait
[WARN ] net.sf.mcf2pdf.pagebuild.PageBackground Background not found for page 0: schwarz_collage_cover_back_portrait
[DEBUG] net.sf.mcf2pdf.pagebuild.PageText Rendering text
[ERROR] net.sf.mcf2pdf.Main An exception has occured
java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.BufferedImage.<init>(Unknown Source)
at net.sf.mcf2pdf.pagebuild.PageText.renderAsBitmap(PageText.java:215)
at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(BitmapPageBuilder.java:75)
at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:224)
at net.sf.mcf2pdf.Main.main(Main.java:202)
The missing page styles/backgrounds are in photofun/categories/12860_specials.xml which itself is listed in photofun/white_list.conf. So far, I found no width or height tags with negative values in the mcf.
Hello, I have the same errors on an "empty. mcf" initialized by Cewe 6.4.5 or 6.3 with mcf2pdf 0.3.4 and his snapshot 0.3.7. The program search for fullcoverpage_quad and fullcoverpage_with_text_quad in ..\photofun\categoriesbackgrounds_default.xml : background designElementId="82070" layout="1" templatename="fullcoverpage_quad,normal" and background designElementId="82076" layout="1" templatename= "fullcoverpage_with_text_quad,normal" But it does not exists in that file !
Have you find a solution to this problem ?
Easiest workaround was to remove the cliparts.
Thank you for your answer. I would have liked it to be a clipart problem but there is none in my empty.mcf file!
Any other solution ?
Just if you want to go the "manual" way. I went the "screenshot" way:
Be aware: The preview window can chew up ridiculously high amounts of memory. I had a memory consumption of some 12GB. Results may vary depending on the compression settings when creating the PDF.
Depending on the converting software and your photobook you might want to set the pdf to open with a view of 2 pages at once. (except the cover).
Thank you for your answer. Unfortunately it is not possible for me to use this procedure : it is too long to convert an album of 104 pages with photos and text.
Actually I found out that with V7.0.1 CeWe changed the structure slightly and current tools need adaption. Currently I give cewe2pdf a try.
Is someone working on a support for CEWE v7.0.1 ?
I switched to https://github.com/bash0/cewe2pdf
Last time I used https://github.com/rbodziony/mcf2pdf with quite nice results, but I am not sure which CEWE version I used. Maybe give it a try.
I last used mcf2pdf on 2018-06-02, and it was working fine on my Fotobuch with excellent result. Awesome! Now I tried again to convert on a new Fotobuch and it failed. I retested to convert the previous Fotobuch (which was working before) and it failed, too.
[INFO ] net.sf.mcf2pdf.Mcf2FoConverter Rendering cover...
[ERROR] net.sf.mcf2pdf.Main An exception has occured
java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.BufferedImage.<init>(Unknown Source)
at net.sf.mcf2pdf.pagebuild.BitmapPageBuilder.addToDocumentBuilder(BitmapPageBuilder.java:66)
at net.sf.mcf2pdf.Mcf2FoConverter.convert(Mcf2FoConverter.java:211)
at net.sf.mcf2pdf.Main.main(Main.java:188)