Forge viewer - Download pdf derivative via API - autodesk-forge

Can I download a pdf from a derivative via API?

It's not clear to me what exactly you're asking for. Below are a couple of answers to what I think your question could be:
You have uploaded a PDF file to the Model Derivative service, and you would like to download the results of the conversion?
While you can download the derivatives of 3D models, I'm afraid it is not possible for PDFs. When processing PDFs, the Model Derivative service converts them to image pyramids to enable Google Maps-like experience where zooming in on different parts of the PDF will load in higher resolution images of the area.
However, if your goal is to be able to load a PDF into the viewer without the Model Derivative service, note that this is also possible: https://aps.autodesk.com/blog/dwf-and-pdf-support-forge-viewer
You have uploaded a design (e.g., a Revit design) to the Model Derivative service, and you would like to download the PDF output that the service generated?
If you're interested in converting Revit designs to PDFs, I would suggest that you generate the PDFs using the Design Automation for Revit as this service is better suited for these types of tasks.

Related

Autodisk forge files

I was wondering, the dwg files are hosted on my server, to use the viewer API do I need to upload it to forge platform then I can use the viewer API?
if yes is there API or otherways to upload the files to the platform I do not want to do it manually
if no this means it's ok I can use the viewer on the files on my server
Regards
In order to show any model (other than PDF) in the Viewer, you need to get it translated to SVF, which is the Viewer's format. This translation can only be done on our servers, so the file needs to be there at least while the translation is running.
https://forge.autodesk.com/blog/showing-files-viewer
We have a nice tutorial on how this can be done: https://learnforge.autodesk.io/#/tutorials/viewmodels

Autodesk Forge viewer: Directly load a SVF?

As the official documentation states, you can upload a source file to OSS and translate it, once in your bucket, to a SVF with the Model Derivative API.
But is it possible to skip the translation step, directly uploading a SVF project (for example, one of these: https://forge-rcdb.autodesk.io/gallery) and loading into the web viewer?
I haven't been able neither to do it nor find any documentation yet.
Yes, that is possible. Instead of loading the Model Derivative service "manifest" using the Autodesk.Viewing.Document.load method, and then loading a specific "viewable" from the manifest using the Viewer3D#loadDocumentNode method, you can just call the viewer's loadModel method and provide an actual URL to your SVF file.
Note however that the Forge Viewer assets (JavaScript, CSS files, icons, etc.) should still be coming from the Autodesk domain. In other words, we do not officially support running the application offline. If you need to support workflows where your users could be temporarily disconnected from the internet, please refer to https://forge.autodesk.com/blog/disconnected-workflows.

Why Layer detection isn't possible in Autodesk forge Api for PDF files?

I want to import PDF file in Model derivative API and work with different layers. But it is not detecting layers in PDF models as it does in DWG files. Layer manager option is not visible. What to do?
In cases where the Model Derivative service isn't extracting enough information from your input files, you have a couple of options:
if your input file is a AutoCAD, Revit, Inventor, or 3ds Max file, consider extracting the additional information using the Design Automation service
if your input file is a PDF, consider:
viewing the PDF directly in the viewer (see this blog post for more details)
using a 3rd party library (e.g., pdf.js) to extract the additional info yourself

Embed the Autodesk Viewer in a web page

In our web application, we want to view AutoCAD files using Autodesk viewer API.
As per our requirement we want to select the file and need to open directly in auto-desk viewer site, where all default options like 2D, 3D views are available.
Is it possible to view those files, directly in Autodesk viewer, instead of creating our own viewer?
We do have a minified online viewer that takes a svf - pls make sure all svf assets are available at the same location and open to public access with CORs allowed:
https://autodeskviewer.com/viewers/latest/viewer3d.html?svf=url/to/your/svf (make sure to put in the url to your svf)
But this is NOT an official setup of any sort and is subject to change w/o notice. You are very much encouraged to develop your own, just a few lines of code would do this trick if you already have your models extracted.
Here's a few good places to start:
https://forge.autodesk.com/en/docs/viewer/v6/tutorials/basic-viewer/
http://learnforge.autodesk.io
Tools:
http://models.autodesk.io
https://extract.autodesk.io/

Autodesk Forge reading from text file

I was just wondering if there is a way to push a text file to Autodesk forge. I've completed a few examples of pushing 3D models to the forge viewer but was wondering if there was a way to push an average text file and for it to be displayed through Forge?
Just an idea of mine, would love to hear of the possibilities!
The Data Management APIs will let you upload any content you want, but the Model Derivative APIs are meant to be used with CAD file formats (and a few additional formats like PDF). You can see all the available translations here: https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/supported-translations. General text files are not supported.