sk1project / uniconvertor

UniConvertor is a cross-platform universal vector graphics translator
https://sk1project.net
GNU Affero General Public License v3.0
154 stars 42 forks source link

Converting a .cdr fails: NoneType' object has no attribute 'PageSize' #4

Open htgoebel opened 9 years ago

htgoebel commented 9 years ago

This happens for both .pdf and svg output.

$ python src/script/uniconvertor page1.cdr page1.pdf
Traceback (most recent call last):
  File "src/script/uniconvertor", line 13, in <module>
    uniconv_run()
  File ".../src/uniconvertor/__init__.py", line 83, in uniconv_run
    convert(input_file, output_file, options)
  File ".../src/uniconvertor/__init__.py", line 106, in convert
    saver(doc, output_file)
  File ".../src/uniconvertor/filters/__init__.py", line 212, in __call__
    module.save(document, file, filename, options)
  File ".../src/uniconvertor/filters/export/pdfgensaver.py", line 437, in save
    saver = PDFGenSaver(file, filename, document, options)
  File ".../src/uniconvertor/filters/export/pdfgensaver.py", line 185, in __init__
    self.pdf.setPageSize(document.PageSize())
AttributeError: 'NoneType' object has no attribute 'PageSize'
´``
How can I help debugging this?

BTW: unittests pass.
htgoebel commented 9 years ago

After I had a look into the source, I assume that cdrloader assumes a single file. But my file is a Zip-Archive with mimetype application/x-vnd.corel.zcf.draw.document+zip.

META-INF/metadata.xml contains

            <cdr:ProductId>0</cdr:ProductId>
            <cdr:ProductName>CorelDRAW X7</cdr:ProductName>
            <cdr:AppVersion>1720</cdr:AppVersion>
            <cdr:BuildNumber>688</cdr:BuildNumber>
            <cdr:Platform>0</cdr:Platform>

And this is the file-list

├── color
│   ├── color.xml
│   ├── docPalette.xml
│   └── profiles
│       ├── cmyk
│       │   └── isocoated_v2_eci.icc
│       └── rgb
│           └── srgb\ color\ space\ profile.icm
├── content
│   ├── data
│   │   ├── Bitmaps.dat
│   │   ├── data1.dat
│   │   ├── masterPage.dat
│   │   ├── page1.dat
│   │   └── page2.dat
│   ├── dataFileList.dat
│   └── root.dat
├── embed
│   ├── embedding0
│   ├── embedding0-Extended.png
│   ├── embedding0.png
│   ├── embedding1
│   ├── embedding1-Extended.png
│   ├── embedding1.png
│   ├── embedding2
│   ├── embedding2-Extended.png
│   ├── embedding2.png
│   ├── embedding3
│   ├── embedding3-Extended.png
│   ├── embedding3.png
│   ├── embedding4
│   ├── embedding4-Extended.png
│   ├── embedding4.png
│   ├── embedding5
│   ├── embedding5-Extended.png
│   ├── embedding5.png
│   ├── embedding6
│   ├── embedding6-Extended.png
│   └── embedding6.png
├── META-INF
│   ├── container.xml
│   ├── links.xml
│   ├── metadata.xml
│   └── textinfo.xml
├── mimetype
├── previews
│   ├── page1.png
│   ├── page2.png
│   └── thumbnail.png
└── styles
    └── document.cdss
mscke commented 8 years ago

I've the same issue with CorelDRAW X7 files

jazzynico commented 8 years ago

Reproduced on archlinux x86_64 with uniconvertor 1.1.5, and on Xubuntu 15.10 with uniconvertor 1.1.4.

jazzynico commented 8 years ago

Test file available on the Launchpad report.

sk1project commented 8 years ago

Hi all,

Thank you for your reports. X7 file format is not supported yet. Just because latest UniConvertor has been released before X7 release. Hope we will add this feature in next UniConvertor 2.0.

jazzynico commented 8 years ago

Ok. Thanks for your answer!

siscia commented 8 years ago

@sk1project I am having a similar issues with a older file.

The file I am trying to convert is here and direct_download

The file is been generated October 2013 while the file format X7 is been introduced in March 2014

siscia commented 8 years ago

Update, it is possible to open the file with OpenOffice Draw