Comments (10)
Many thanks!!!
Great job, works like a charm!
Looking through the code, I'm pretty sure you saved a lot of my time.
Have fun coding!
Marek
from pdf-writer.
OK, so looked into this a bit, downloaded PDF-XChange and tried to create PDF with default settings only. meaning no views definition, so relies on what's defined in the U3D file itself. attaching here the modified main.cpp (as zip, per attachments reqs), in case it'll be helpful to you
building.pdf
cube.pdf
main.zip
With this setup we're pretty much relying on what the u3d define for default view and hope for the best. I saw that in acrobat i can see both elements, albeit it's good to use the toolbar to change the background to white or light gray, and make sure the lighting is set to either CAD optimized lights or Primary Color lights. for PDFXchange, the building appears blank...but it's there, just change the lighting toe Primary Color lights, and change the background color to light gray and you'll see it [this seems to be a good setup also for the cube].
not sure there's a one size fit all solution here, because it is all pretty much dependent on the u3d files and what default views they define. but note that the initial example does show how to create your own views in the PDF which sets particular settings (like lighting and camera matrix) to customize the view). the PDF reference manual section 9.5.3 discusses the options you can put in a view. you can have a couple (as the initial example shows) and even choose one to appear on load as a default one (see the "Default" value for DV in the 3D dictionary definition in the example). i keep a useful link to dld the pdf reference manual here.
from pdf-writer.
Wow! Thanks a alot for the thorough answer.
I mean, I'm totally fresh in PDF creation. And I learent about the U3D format just last week, while researching the capabilities of your library. So. I was really thankful for your example and the fact that your library does support embedding of U3D in PDFs.
And did not have much time to play with your code too much, just incorporated it in my example code.
Now I think, I know enough to get started :)
from pdf-writer.
Cheers,
While i did remove the example i was able to locate the emailing i had with the guy i mentioned there.
created the folder with the example, updated the link there and here it is as well:
https://app.box.com/s/tpqf9jfmvxcw13gig0ljh9p31got1rqh
Gal.
from pdf-writer.
Hi again,
I dared to reopen this issue :-P
I played around with it and tried to add different u3d files but only a very simple one got displayed.
Some of them cannot get displayed in the document. They are clearly in the document because their structure is recognized and can be listed.
But the 3D view is empty.
Would you be so kind and take a look at the attached U3D? It's one of those not working.
I wonder if it is a defect in the file, or if there's some setting that needs to be turned on/off?
from pdf-writer.
not sure why, but i cant seem to be able to open the zip file.
from pdf-writer.
also, maybe save me some time and provide both u3d object and the PDF generated
from pdf-writer.
testing-with-buidling.pdf
testing-with-cube.pdf
building.zip
Sorry, my bad with the zip file.
I attached it once again, as well as a PDF containing it and another one containg the cube that you provided.
What I found out is that Adobe's PDF viewer shows the building, although small and at the bottom of the page - probably some camera settings..
However, PDF-XChange Editor does not show the building, no matter what I tried. Yet, it does show the cube normally.
Might be, that PDF-XChange Editor has some issue.
If you find some time to take a look at it, it would fabulous :-)
from pdf-writer.
yeah, you probably dont want to use the exact same views definitions, but rather use those that are relevant to the model at hand. especially size and point of origin im guessing (not really a u3d or cad expert). i seem to detect that you just used the same views and i guess that's the point of issue. one thing to try is to start from a PDF that uses default views instead.
from pdf-writer.
with acrobat you can right click "part options"->"fit visible" to see the building properly sized.
from pdf-writer.
Related Issues (20)
- Can not modify a document by creating a new form XObject and using it in one of the pages HOT 3
- [Question] - pdf to image HOT 1
- Question about attachments HOT 2
- some example projects in wiki are missing HOT 2
- Streams objects writing problem HOT 2
- Add watermark to PDF HOT 7
- Missing lib.obj file HOT 3
- Android Build Workflow HOT 3
- CIDSet encoding does not conform with ISO 19005-2:2011, ISO 19005-3:2012 (PDF/A-2b or PDF/A-3b) HOT 21
- annotations are lost with PDFDocumentCopyingContext::AppendPDFPageFromPDF HOT 3
- How to draw Bezier curves using PDF-Witer library๏ผ HOT 2
- Parse a screenplay into scene objects? HOT 2
- color emojis HOT 16
- Links are removed when documents are merged HOT 8
- Color inversion problem occurs when exporting images HOT 1
- infinite loop HOT 2
- Crash when WriteUsedFontsDefinitions HOT 17
- Publish to github releases without PDFWriterTesting HOT 4
- `Segmentation fault (core dumped)` just for adding `PDFWriter pdfWriter` in the `h` file HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-writer.