Design automation v3: pdf Plot doesn't display pdf & image attached - autodesk-forge

I'm trying to plot a dwg with pdf & images attached to it.
Dwgs export well, but images and pdfs attached to it are not visible.
I'm using a custom activity with the PlotEngine.
Is it a problem on the forge side? Or is it possible to fix this bug directly in the AppPackage

Can you check whether you have supplied the image file that you attached into the drawing as an input argument? If your input argument only specifies the host drawing file, then the Design Automation does not know where the image is and it will treat it as an unresolved reference. In this case, the image won't be plotted into the PDF.

Related

How to export markups created for Inventor (drawing/part/assembly) file to PDF from viewer

We have created a markup extension in the autodesk viewer. Is it possible to export a markup to PDF using APIs.
The online viewer from Autodesk has Print button which looks to be calling window.print(). Is this the way to print the drawing to PDF?
In the viewer from "Comments" I open a specific markup and ("view markup" window) click "Print" and it prints drawing without markups.
The button "Export" under "Comments" is exporting all the markups into a single PDF file. How do we do this using forge APIs.
Is it possible to print only selected a markup instead of all the markups.?
Thank You for your help.
There is no official/supported way of doing this using the Viewer APIs but you might be able to get markups "baked" into a PDF by combining multiple features/libraries:
the Markups extension in Forge Viewer allows you to render the markups into a PNG file; see this Stack Overflow answer: Autodesk Forge get screenshot with markups
there are 3rd party libraries that allow you to insert semi-transparent PNG images into PDFs, for example pdfkit: https://pdfkit.org/docs/images.html
since the Markups extension uses an <svg> element under the hood, you should also be able to hide any of the SVG elements you don't want included in the PNG

Using LeafletLoader instead of PDFLoader to load a PDF into the forge viewer is not working

I want to load a large image into the forge viewer. I embedded the image in a pdf. However, when loading the pdf the vector pdf's resolution is not high enough and visibly worse than in the original pdf. Threfore, I am trying to load it via the LeafletLoader as described in this blogpost. However, setting LMV_RASTER_PDF did not switch to the LeafletLoader (LMV_VECTOR_PDF is set to false). The loader used is still the PDFLoader.
Is there a setting I am missing or is there a way to load a leaflet map directly with the forge viewer? (LMV 7.40.0)
The PDF file needs to be translated to SVF - that's going to generate the leaflets.
https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/prep-file4viewer/task3-translate-source-file/

Exporting markup data in RVT/CAD format

I am using Autodesk Markupscore Extension to draw markups on 2D view. I want to create a separate rvt or CAD file for the drawn markup, which can further be used/opened in Revit soft. So the newly created 2D view(rvt/CAD) will contain only that part of 2D view which is inside the drawn markup, How can I achieve this?
I can't comment on the Revit specific piece (for that I would suggest that you check out the Revit discussion forums) but if we're talking about where Forge can help, I see two options:
you could have a Revit plugin running in the Forge Design Automation service, accepting a Revit document and some coordinates of 2D markups on the input, removing design elements that are outside of the 2D markups via Revit APIs, and generating a new Revit document on the output.
you could customize Forge Viewer to hide or occlude the parts of the 2D drawings you don't want to be visible, for example, by "hiding" them (making them semi-transparent), by changing their color, or by overlaying them with another content such as a blank SVG rectangle.

Plan from Revit becomes a picture in forge viewer

So when I export my Revit file to the Forge Viewer the 2D plan I want to look at does not have any selectable elements because it somehow was exported as a picture.
It is only my assumption that it was exported as a picture since it becomes blurry when I zoom in. Is this a known issue or does my plan need a special property to be able to be translated to forge properly?
Using a demo file everything works perfectly but using a file coming from a different source does not seem to work properly
There are a few reasons for a view to becoming a raster:
uses shading, shadows, gradients, or sketchy lines.
is rendered.
contains an image.
uses point clouds.
contains a decal. (Includes Revit Annotation elements, such as section, spot, text, and etc.)

How to use jspdf with google maps

I am using jspdf to convert a html page to pdf. My page has a google map displayed on it.
I am confused as to how to display that map on the pdf. Can anybody help?
Thanks
Try using the new addHTML() function.
This function will canvas the HTML DOM (In your case a DIV) and convert it to an Image using anopther library called html2canvas and add that image (in you case the Google Map) to your PDF.
Example codes are available in GitHub.
Or alternatively you can attach an image of your Google map (if it points out a stable place) to your PDF.