Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing some text functions #5

Open
bmffb opened this issue Jan 15, 2021 · 5 comments
Open

Missing some text functions #5

bmffb opened this issue Jan 15, 2021 · 5 comments

Comments

@bmffb
Copy link

bmffb commented Jan 15, 2021

First of all: Thanks for this great piece of software. After getting frustrated with the mcf2pdf Java software (due to changes in the latest Cewe .mcf files, using version 7+) and getting the cewe2pdf Python script not running (on a Win10 machine) I got your software to work. The production of pdf files is very fast!

Unfortunately, I am missing some functions which would be great to incorporate into next versions. Here some examples:

  • some text decorations like rotating a textbox are not handled
  • background of textbox is not handled
  • the alignment of text seems to be always "left". I would need "justify".
  • corner decorations of images are seemingly not supported:
    example:
    <corners enabled="yes"> <corner length="15" shape="convex" where="top-right"/> <corner length="15" shape="convex" where="bottom-left"/> <corner length="15" shape="convex" where="top-left"/> <corner length="15" shape="convex" where="bottom-right"/> </corners>
    I guess it is resulting in the following log entry: "[Warning] No style for span: ' '."
  • an option for "one-page" or "double-page" pdf would be great.

Regards and happy coding.

@stfnk
Copy link
Owner

stfnk commented Jan 15, 2021

Hi, thanks for the detailed feedback!

I just implemented the easy ones for the upcoming version 0.3.0:

  • textbox (and image) rotation now works
  • textbox background colors work
  • justify alignment works, but may produce slightly different results from the Cewe software. This will probably never match perfectly.

These changes are available in Cewe2pdf-v0.3.0-alpha3 here.

Just had a quick look at decorations, getting them to work in all corner combinations including borders and shadow will take some time. Will probably work on that after 0.3.0.

I agree that an option for single page pdfs would be really nice to have. But that requires some deeper changes, not likely to happen soon.

Let me know if you find more problems :)

@bmffb
Copy link
Author

bmffb commented Jan 16, 2021

Dear Stefan,
Thanks for the quick response and the great improvements.
I confirm you that the following functions work successful for my recent fotobook:

  • textbox rotation
  • textbox color background
  • justify alignment of text (was actually nearly perfect in my case)
    Regards
    Bernard

@gizmo21
Copy link

gizmo21 commented Mar 23, 2021

Vertical text on cover-spine seems not to be handled,

Converting 4 pages.
Starting conversion. This may take several minutes.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled area type in <page/area> 'spinelogoarea'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[0,0%]  processing Page 1/4...
[Info]    Added 429 Design IDs to resource cache.
[Info]    Loading DesignID from path: C:\Program Files\d*\d*-Fotowelt//Resources//photofun/backgrounds/einfarbige/229.webp
[Info]    Rendering Image: xxxxxxxxxxxxxxxxxxx
[Info]    Rendering Image: xxxxxxxxxxxxxxxxxxx
[Info]    Rendering Text: font=Calibri; size=20; align=ALIGNVCENTER; valign=ALIGNLEADING
[Warning] Unhandled text align: 'ALIGNVCENTER'.
[Warning] Unhandled text vertical align: 'ALIGNLEADING'.
        remaining: ~1 minutes.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.

For the spine-size there were some problems with big books (many pages) in the other converters, just for info:
albrechtf/mcf2pdf#15
albrechtf/mcf2pdf#37


Update:

sorry just saw Roadmap (shame on me):

  • spine text
  • vertical text alignment

@stfnk
Copy link
Owner

stfnk commented Mar 25, 2021

Which version are you using? The current alpha release should already handle spine text and vertical alignment fine.

I think spine size should always be handled correctly.

The roadmap is actually somewhat outdated... the readme still needs some reworking for the final 0.3.0 release :)

@gizmo21
Copy link

gizmo21 commented Mar 29, 2021

yes I used 0.3.0 alpha 6

I just tested it again using the standard spinetext field and on top adding a usual textarea also moved to spine area side-by-side.
The usual textarea is rendered correctly ON the spine-area (so that is a workaround for PDF generation), but the dedicated spinetext does not apear and throws the errors:
[Warning] Unhandled text align: 'ALIGNVCENTER'.
[Warning] Unhandled text vertical align: 'ALIGNJUSTIFY'.
No matter what font, size, color, alignment

Cewe2pdf v0.3.0-alpha6 [Release]
[Info]    Set 'ToPage' to '2'.
[Info]    Loading config from 'config.txt'...
[Info]    Set 'ProgramPath' to 'C:\Program Files\d*\d*-Fotowelt'.
[Info]    Loading config defaults...
[Info]    Set 'ImgScale' to '1'.
[Info]    Using Config:
                ToPage=2
                ProgramPath=C:\Program Files\d*\d*-Fotowelt
                ImgScale=1
Loaded 'FOTOBUCH.mcf'.
[Info]    mcf content:
<fotobook>
        art_id=9733
        productname=ALB41
        <project>
                createdWithHPSVersion=7.1.2
        <articleConfig>
                normalpages=114
                totalpages=119
[Warning] Unhandled Node in <fotobook> 'project'.
[Warning] Unhandled Node in <fotobook> 'savingVersion'.
[Warning] Unhandled Node in <fotobook> 'creationHistory'.
[Warning] Unhandled Node in <fotobook> 'articleConfig'.
[Warning] Unhandled Node in <fotobook> 'addOns'.
[Warning] Unhandled Node in <fotobook> 'extra'.
[Warning] Unhandled Node in <fotobook> 'userfeedback'.
[Warning] Unhandled Node in <fotobook> 'fotoRelationships'.
[Info]    Loading fonts from C:\Windows\Fonts
[Info]    Loading fonts from C:\Program Files\d*\d*-Fotowelt\Resources\photofun\fonts
[Info]    Searching for fonts directory at C:\ProgramData\hps
[Info]    Loading fonts from: 'C:\ProgramData\hps\1320\photofun\fonts'.
[Info]    Loading fonts from: 'C:\ProgramData\hps\1320\addons\fontspackage\fonts'.
[Info]    Found 2750 fonts.
Converting 2 pages.
Starting conversion. This may take several minutes.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[0,0%]  processing Page 1/2...
[Info]    Added 429 Design IDs to resource cache.
[Info]    Loading DesignID from path: C:\Program Files\d*\d*-Fotowelt//Resources//photofun/backgrounds/einfarbige/229.webp
[Info]    Rendering Image: original size=4928x3264; scaled size=1036x686
[Info]    Rendering Image: original size=3888x2592; scaled size=1089x726
[Info]    Rendering Text: font=Calibri; size=36; align=ALIGNVCENTER; valign=ALIGNJUSTIFY
[Warning] Unhandled text align: 'ALIGNVCENTER'.
[Warning] Unhandled text vertical align: 'ALIGNJUSTIFY'.
[Info]    Rendering Text: font=Calibri; size=36; align=ALIGNJUSTIFY; valign=ALIGNVTOP
        remaining: ~1 minutes.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.
[Warning] Unhandled Node in <page> 'background'.

This is the (edited) mcf:

<?xml version="1.0" encoding="UTF-8"?>
<fotobook art_id="9733" article_name="CEWE%20FOTOBUCH%20Gro%C3%9F%20Panorama%20Hardcover%20auf%20Fotopapier%20Matt" externalProjectId="" folderID="xxxxxxxxxxxxx" imagedir="FOTOBUCH_mcf-Dateien" isDataMcf="0" productname="ALB41" startdatecalendarium="" useSpineLogo="0" version="4.0">
    <project createdWithHPSVersion="7.1.2" createdWithHPSVersionBuild="20201117" projectID="xxxxxxxxxxxxxxxxxxxxxxx" projectIDCreatedEpoch="xxxxxxxxxxxxxx"/>
    <savingVersion compatibilityVersion="6.4.2" programversion="7.1.2" programversionBuild="20201117" savetime="xxxxxxxxxxxxxx"/>
    <creationHistory clientId="38" clientVersion="7.1.2-20201117-default" creationDate="2021-03-13 10:48"/>
    <articleConfig normalpages="114" pagenaming="1" totalpages="119"/>
    <addOns/>
    <pagenumbering bgcolor="#00000000" fontbold="0" fontfamily="Calibri" fontitalics="0" fontsize="24" format="0" margin="111" position="0" textcolor="#ff000000" textstring="%" verticalMargin="50">
        <outline width="1"/>
    </pagenumbering>
 <extra>
        <lastTextFormat Alignment="ALIGNHCENTER" IndentMargin="0" VerticalIndentMargin="0" backgroundColor="#00000000" font="Calibri,28,-1,5,50,0,0,0,0,0" foregroundColor="#ff000000" hasOutline="1" outlineColor="#00000000" outlineWidth="1"/>
    </extra>
    <page designStyleID="-1" pagenr="0" rotation="0" type="fullcover">
        <bundlesize height="2100" width="5755"/>
        <designElementIDs background="229" layout="384109"/>
        <background alignment="4" designElementId="229" rotation="0" type="1"/>
        <background designElementId="384109" layout="1" templatename="full_page_fotobooks,normal"/>
        <area areatype="imagearea">
            <position height="1716.99" left="168.696" rotation="0" top="188.48" width="2240.45" zposition="100"/>
            <decoration/>
            <image filename="safecontainer:/xxxxxxxxxxxxxxxx.JPG" useABK="1">
                <cutout left="-311.779" scale="0.526039" top="-0.000984001"/>
            </image>
        </area>
        <area areatype="imagearea">
            <position height="1816" left="3131.87" rotation="0" top="142" width="2504.26" zposition="102"/>
            <decoration/>
            <image filename="safecontainer:/xxxxxxxxxxx.JPG" useABK="1">
                <cutout left="-218.745" scale="0.700617" top="8.00016e-14"/>
            </image>
        </area>
        <area areatype="spinetextarea">
            <position height="271" left="1877.5" rotation="270" top="914.5" width="2000" zposition="7000"/>
            <decoration/>
            <text applySpotColor="0" areaTextType="spine"><![CDATA[<!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:28pt; font-weight:400; font-style:normal;"><table style="-qt-table-type: root; margin-top:75px; margin-bottom:0px; margin-left:0px; margin-right:0px;"><tr><td style="border: none;"><p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">SPINETEXT</span></p></td></tr></table></body></html>]]><outline width="1"/>
                <textFormat Alignment="ALIGNJUSTIFY,ALIGNVCENTER" IndentMargin="0" VerticalIndentMargin="50" backgroundColor="#00000000" font="Calibri,28,-1,5,50,0,0,0,0,0" foregroundColor="#ff000000" hasOutline="1" outlineColor="#00000000" outlineWidth="1"/>
            </text>
        </area>
        <area areatype="textarea">
            <position height="997.178" left="2783.56" rotation="270" top="555.724" width="577.111" zposition="7000"/>
            <decoration/>
            <text applySpotColor="0" areaTextType="content"><![CDATA[<!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:28pt; font-weight:400; font-style:normal;"><table style="-qt-table-type: root; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;"><tr><td style="border: none;"><p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p><p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#000000;"><br /></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=" color:#000000;">TEXTAREA</span></p></td></tr></table></body></html>]]><outline width="1"/>
                <textFormat Alignment="ALIGNHCENTER" IndentMargin="0" VerticalIndentMargin="50" backgroundColor="#00000000" font="Calibri,28,-1,5,50,0,0,0,0,0" foregroundColor="#ff000000" hasOutline="1" outlineColor="#00000000" outlineWidth="1"/>
            </text>
        </area>
    </page>
    <page designStyleID="-1" pagenr="0" rotation="0" type="spine">
        <bundlesize height="2100" width="5755"/>
        <designElementIDs background="229"/>
        <background alignment="4" designElementId="229" rotation="0" type="1"/>
    </page>
    <page designStyleID="-1" pagenr="0" rotation="0" type="fullcover">
        <bundlesize height="2100" width="5755"/>
        <designElementIDs background="229" layout="125270"/>
        <background alignment="4" designElementId="229" rotation="0" type="1"/>
        <background designElementId="125270" layout="1" templatename="koordinaten_weiss_cover_back_landscape,normal"/>
    </page>

If I put position height="997.178" and top="555.724" of the usual textarea into the spinetextarea values, text is at least viewable, so it is rendered but outside of the viewable part.

So perhaps some positioning trouble with my special landscape book article (bundlesize?) and huge pagenumber (and therefore spinesize?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants