-
1. Re: 3D JavaScript: I cannot create Image object from embedded JPEG file
Dave Merchant Aug 22, 2011 7:43 AM (in response to A. Grahn)Your bitmaps must be attached as Resources of the 3D annotation - it sounds like you're creating the PDF with third-party tools, in which case if there are any errors in the structure of the tags you're building, you will get the error as you're seeing it (you can create a Resource from anything provided there's a matching name, but you can only create an Image from that Resource if the Cos object exactly matches the specs - if creation of the Image fails you get a 0x0 "image" with zero color depth, corresponding to the prototype of the Image object).
Suggest you inspect your PDF's Cos tree (via Preflight) and compare it to a 3D scene with Resources created using the Acrobat Pro dialogs. Something will be different, but i can't predict what.
-
2. Re: 3D JavaScript: I cannot create Image object from embedded JPEG file
A. Grahn Aug 23, 2011 12:41 AM (in response to Dave Merchant)Thanks, Dave, for your reply.
Your bitmaps must be attached as Resources of the 3D annotation
This I did. Something becomes a resource if it is referenced in the Assets Name Tree of the RichMediaContent directory. Names are matching. The step of creating the Resource is working. But creating the Image Object fails if the Resource was created from embedded file stream, but succeeds if the Resource was created from XObject. Perhaps, for creating the Image Object, JavaScripts needs the info about image size/colour depth etc. stored in the Image XObject dictionary. Such information is not present in the dict of the EmbeddedFile stream:
6 0 obj
<<
/Type /Annot
/Subtype /RichMedia
/Rect [133.92 564.12 236.88 667.2]
/RichMediaContent 23 0 R
/RichMediaSettings 24 0 R...
>>
endobj23 0 obj
<<
/Assets
<<
/Names [(dice.u3d) 14 0 R (sunset.jpg) 15 0 R]
>>
...
>>
endobjsunset.jpg as Image XObject works; it can be loaded by JavaScript:
15 0 obj
<<
/ColorSpace /DeviceRGB
/Subtype /Image
/Filter /DCTDecode
/Length 6817
/Width 320
/Height 308
/BitsPerComponent 8
>>
stream
ÿØÿî.......
endstream
endobj
alternatively:
sunset.jpg as Filespec ->EmbeddedFile; cannot be loaded by JavaScript: Image Object is 0 x 0:
15 0 obj
<<
/EF
<<
/F 16 0 R
>>
/F (sunset.jpg)
/Type /Filespec
/UF (sunset.jpg)
>>
endobj16 0 obj
<<
/Length 6817
>>
stream
ÿØÿî.......
endstream
endobj
Yes, I'am using a third party tool (pdfTeX) for pdf creation. BTW, does AA-X use the RichMedia annot for 3D or still the old 3D annot of AA-7? Thanks once more for your answer!
Alexander
-
3. Re: 3D JavaScript: I cannot create Image object from embedded JPEG file
Dave Merchant Aug 23, 2011 3:49 AM (in response to A. Grahn)Correct - it needs those tags. Here's a screenshot of the structure when you use Acrobat Pro (one 3D scene, one Resource added, "bitmap.jpg") - as you can see the image is stored as an XObject, with the 3D model data elsewhere in the tree (the Binary Stream above the 3DV entry)
3D annotations in Acrobat 9 and X are stored using the spec in part 9.5 of ISO 320000/1.7EL3 - they're similar to Rich Media Annotations, but not exactly equivalent. However if you add a SWF file to a 3D annotation's Resource table, the entire annot is repacked as a Rich Media Annotation (/T:Annot /S:RichMedia) with the 3D model and Resources both stored as FileSpec objects in the Assets library. Entries in the RichMediaSettings tree tell the renderer that it's still a 3D scene, but we need to switch containers like this as a 3D annot has limited support for non-Image Resources.
-
4. Re: 3D JavaScript: I cannot create Image object from embedded JPEG file
A. Grahn Aug 23, 2011 4:41 AM (in response to Dave Merchant)Thanks a lot for clarification!
And thanks that you mentioned SWF. I am able to attach an SWF as a resource (Filespec) but cannot make use of it (trough 3D JavaScript). I tried to create a FlashMovie object from the Resource and then use it with the scene.addFlashForeground method. But I cannot see an effect within the 3D scene. What would be a typical use of an SWF resource in 3D context? Could you please give a short JavaScript example on how to make use of an SWF resource?
Thanks in advance
Alexander
-
5. Re: 3D JavaScript: I cannot create Image object from embedded JPEG file
Dave Merchant Aug 23, 2011 8:54 AM (in response to A. Grahn)Suggest you watch our on-demand tutorials, as it's quite a convoluted issue.
http://acrobatusers.com/tutorials/using-flash-3d-material-part-1-2
http://acrobatusers.com/tutorials/using-flash-3d-material-part-2-2





