pdf importer crashes #50286

Closed
opened 2016-12-21 10:35:22 +01:00 by matali23 · 18 comments

System Information
win7 x64

Blender Version
Broken: 6c3d8fb

Short description of error
Some PDF won't import at all and give the following error:

Traceback (most recent call last):
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 204, in execute
    self.action(context)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 173, in action
    (mdl, msg) = import_vecfile.ReadVecFileToModel(self.filepath, options)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\import_vecfile.py", line 72, in ReadVecFileToModel
    art = vecfile.ParseVecFile(fname)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\vecfile.py", line 128, in ParseVecFile
    contents = pdf.ReadPDFPageOneContents(filename)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 596, in ReadPDFPageOneContents
    return GetPDFPageOneContents(contents)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 667, in GetPDFPageOneContents
    return GetPDFStreamContents(contentsobj, s, crossrefs)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 905, in GetPDFStreamContents
    ans = ans.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9f in position 19206: invalid start byte

location: <unknown location>:-1
	

or

Problem reading file path/to/pdf.pdf: Problem reading file or unhandled type

or

Traceback (most recent call last):
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 204, in execute
    self.action(context)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 173, in action
    (mdl, msg) = import_vecfile.ReadVecFileToModel(self.filepath, options)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\import_vecfile.py", line 72, in ReadVecFileToModel
    art = vecfile.ParseVecFile(fname)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\vecfile.py", line 128, in ParseVecFile
    contents = pdf.ReadPDFPageOneContents(filename)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 596, in ReadPDFPageOneContents
    return GetPDFPageOneContents(contents)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 617, in GetPDFPageOneContents
    (trailerdict, crossrefs) = GetPDFTrailerAndCrossrefs(s)
  File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 518, in GetPDFTrailerAndCrossrefs
    while crossrefi > 0:
TypeError: unorderable types: tuple() > int()

location: <unknown location>:-1


depending on the file.

Exact steps for others to reproduce the error
Can't attach a file because of rights. But it happens with all tried files but one so far. I can't edit those files because of missing tools and those files where made by another Company. They all open fine in Adobe reader and SumatraPDF.

**System Information** win7 x64 **Blender Version** Broken: 6c3d8fb **Short description of error** Some PDF won't import at all and give the following error: ``` Traceback (most recent call last): File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 204, in execute self.action(context) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 173, in action (mdl, msg) = import_vecfile.ReadVecFileToModel(self.filepath, options) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\import_vecfile.py", line 72, in ReadVecFileToModel art = vecfile.ParseVecFile(fname) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\vecfile.py", line 128, in ParseVecFile contents = pdf.ReadPDFPageOneContents(filename) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 596, in ReadPDFPageOneContents return GetPDFPageOneContents(contents) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 667, in GetPDFPageOneContents return GetPDFStreamContents(contentsobj, s, crossrefs) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 905, in GetPDFStreamContents ans = ans.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9f in position 19206: invalid start byte location: <unknown location>:-1 ``` or ``` Problem reading file path/to/pdf.pdf: Problem reading file or unhandled type ``` or ``` Traceback (most recent call last): File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 204, in execute self.action(context) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\__init__.py", line 173, in action (mdl, msg) = import_vecfile.ReadVecFileToModel(self.filepath, options) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\import_vecfile.py", line 72, in ReadVecFileToModel art = vecfile.ParseVecFile(fname) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\vecfile.py", line 128, in ParseVecFile contents = pdf.ReadPDFPageOneContents(filename) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 596, in ReadPDFPageOneContents return GetPDFPageOneContents(contents) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 617, in GetPDFPageOneContents (trailerdict, crossrefs) = GetPDFTrailerAndCrossrefs(s) File "F:\builds\blender-2.78.0-git.6c3d8fb-windows64\2.78\scripts\addons_contrib\io_vector\pdf.py", line 518, in GetPDFTrailerAndCrossrefs while crossrefi > 0: TypeError: unorderable types: tuple() > int() location: <unknown location>:-1 ``` depending on the file. **Exact steps for others to reproduce the error** Can't attach a file because of rights. But it happens with all tried files but one so far. I can't edit those files because of missing tools and those files where made by another Company. They all open fine in Adobe reader and SumatraPDF.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @matali23

Added subscriber: @matali23
Howard Trickey was assigned by matali23 2016-12-21 10:35:46 +01:00
Author

exact same problems are in 2.78a.

exact same problems are in 2.78a.
Member

Without an example file where this crash happens, I can't fix it. What kind of rights error do you get when trying to add a file? I see that you have been successful uploading files in other bug reports; e.g., blender/blender#50276

Without an example file where this crash happens, I can't fix it. What kind of rights error do you get when trying to add a file? I see that you have been successful uploading files in other bug reports; e.g., blender/blender#50276
Author

@Howardt. I mean the pdf intellectual property. I'm not allowed because of laws if you prefer. The pdf where made with Autocad if I'm right, but I don't have it, so I can't send a dummy file with the problem.

@Howardt. I mean the pdf intellectual property. I'm not allowed because of laws if you prefer. The pdf where made with Autocad if I'm right, but I don't have it, so I can't send a dummy file with the problem.
Author

tried to edit the pdf in another program, I removed enough things to make the pdf import, but it is now like rotated 180° on x axis (so it's up down)
On the left, Blender (Wrong) on the right, acrobat reader (right)
bug pdf upside down.PNG
For this, I can attach a file:
but upside down.pdf

tried to edit the pdf in another program, I removed enough things to make the pdf import, but it is now like rotated 180° on x axis (so it's up down) On the left, Blender (Wrong) on the right, acrobat reader (right) ![bug pdf upside down.PNG](https://archive.blender.org/developer/F420934/bug_pdf_upside_down.PNG) For this, I can attach a file: [but upside down.pdf](https://archive.blender.org/developer/F420933/but_upside_down.pdf)

Added subscriber: @Sergey

Added subscriber: @Sergey

@matali23, we can only fix bugs which we can reproduce and for that we do need a .pdf file which demonstrates the issue. If you can't share original .pdf make a new one. That's really the only way we can solve the issue.

Mixing two issues in one report is also not the greatest idea.

@matali23, we can only fix bugs which we can reproduce and for that we do need a .pdf file which demonstrates the issue. If you can't share original .pdf make a new one. That's really the only way we can solve the issue. Mixing two issues in one report is also not the greatest idea.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

No news in more then a week closing.

No news in more then a week closing.
Author

Ok, I managed to get access to the computer producing the pdf files. Here is an example file: Ohne Titel1.pdf. It imports without problem in inkscape, photoshop, etc...

Ok, I managed to get access to the computer producing the pdf files. Here is an example file: [Ohne Titel1.pdf](https://archive.blender.org/developer/F430453/Ohne_Titel1.pdf). It imports without problem in inkscape, photoshop, etc...
Author

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
matali23 reopened this issue 2017-01-09 10:31:33 +01:00
Member

Thanks for the file. I tried importing it, and it did not crash.
Can you please tell me the version of the pdf importer that you have on your computer?
Under binary directory where blender lives, there should be a file like
2.77/scripts/addons_contrib/io_vector/init.py

It has a version number in it.
Also, maybe just upload the file pdf.py that is in that directory into this bug.
Thanks.

Thanks for the file. I tried importing it, and it did not crash. Can you please tell me the version of the pdf importer that you have on your computer? Under binary directory where blender lives, there should be a file like 2.77/scripts/addons_contrib/io_vector/__init__.py It has a version number in it. Also, maybe just upload the file pdf.py that is in that directory into this bug. Thanks.
Author

After updating to latest buildbot, the file "Ohne Titel1.pdf" imports correctly, but the original file still doesn't. Sorry for the bad example, will put as incomplete until I can make a simple example.

After updating to latest buildbot, the file "Ohne Titel1.pdf" imports correctly, but the original file still doesn't. Sorry for the bad example, will put as incomplete until I can make a simple example.
Member

Added subscriber: @TheOnlyJoey

Added subscriber: @TheOnlyJoey
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

This report has passed the limit of inactivity, will be closed as archived.

This report has passed the limit of inactivity, will be closed as archived.
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#50286
No description provided.