PDF

Next
 From:  DannyT (DANTAS)
3637.1 
Hi Michael,

I tried to open the attached pdf with MoI for reference without success, is there something different about it ?

Cheers
~Danny~

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3637.2 In reply to 3637.1 
Hi Danny, unfortunately PDF is a very complex format with all kinds of various chunks of data strewn about the file in different structures and with different kinds of compression applied to them, all kinds of stuff like that. There are a lot of different possible ways the current MoI PDF reader can get confused when trying to get at the stuff in a PDF file.

In the future I want to do an overhaul of that area and probably license a PDF reading library so that it will work better.

In the meantime, Rhino is able to read this particular PDF file, so I have converted it to 3DM that way, I'm attaching the converted 3DM file here for you.

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3637.3 In reply to 3637.1 
Hi Danny, so I examined the PDF file and the reason that MoI has trouble reading it is that all the operators in it are just one big long chunk of text like this:

gs q 0.21609 0 0 0.21609 0 0 cm 13449.7 225.625 m 13449.7 290.531 l 13501.6
225.625 l 13501.6 290.531 l S Q q 0.21609 0 0 0.21609 0 0 cm 13534.2 225.625
m 13560.1 225.625 l 13573.1 238.605 l 13573.1 277.551 l 13560.1 290.531 l

MoI's reader does not deal with that properly, it's expecting for the operators to be more like in an AI v8 style where there is only one per line, like this:

13449.7 225.625 m
13449.7 290.531 l
13501.6 225.625 l
13501.6 290.531 l
13501.6 290.531 c


Anyway, that's the particular reason why it doesn't work with MoI's current PDF importer - the current PDF importer is not that great, it's kind of spliced around the AI v8 reader that just tries to decompress wads of anything it can find in the PDF file and feed it to the AI v8 parser. But in some cases like this one the operators are structured a bit differently between those formats, although in many PDF files they are the same.

PDF is so complicated that I don't really have very much hope of being able to fix up my own reader, I will most likely be licensing a library to help with this in the future.

- Michael

EDITED: 25 Jun 2010 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3637.4 In reply to 3637.1 
I opened your file in illustrator and saved it out as a pdf 5 or 1.4 version and MoI read it in. If I open your original file in notepad, it appears more like binary data where the illustrator one looks like ascii... Yours started with pdf1.3 and the illustrator one started with pdf1.4.

FYI
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3637.5 In reply to 3637.4 
It also looks like it may have been created on a "Mac OSX" box.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  DannyT (DANTAS)
3637.6 
Thanks Michael for converting the file for us and thanks Burr for having a look also, some good tips there.

Cheers
~Danny~
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3637.7 
And what about the 3Dpdf format?
http://www.pdf3d.co.uk/pdf3d_overview.php
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3637.8 In reply to 3637.7 
Hi Pilou, I have not really looked that deeply into 3D PDF, it's pretty much a completely separate thing from the regular 2D page-oriented PDF stuff.

It would need completely separate code for trying to read in the 3D PDF stuff, I don't really expect to be able to do that.

Also 3D PDF files are not generally used as a method to transfer 3D data between applications, they are more used for output only to make a file to be displayed in the PDF viewer.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  rhodesy
3637.9 
Any word on a possible dxf import option? PDF as you say is a bit flakey, would be good to have a robust way to import 2D CAD data.

cheers
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
3637.10 In reply to 3637.9 
Hi Rob, I would like to add DXF import.

But probably DXF export will come first, importers are usually many times more difficult to create than exporters.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All