Exporting an existing ArcGIS map layout using arcpy does not export the elements - pdf

I am attempting to export an already existing and styled map layout to pdf, programmatically from outside the ArcGIS environment. Although the export is successful, only the map element appears in the export, also the orientation (landscape) specified in the project is ignored in the exported pdf.
I would appreciate suggestions on how to ensure all my elements are included in the export and at the right orientation.
here is the code
import arcpyfrom arcpy.mp import *
aprx = arcpy.mp.ArcGISProject(r"C:\Users\xeon\Desktop\GIS IP Class\Python Tiede\mapping\project.aprx")
layout = aprx.listLayouts()[0]
outpath= r"C:\IPProject\IPProject_files\GithubIP\Vector\pdfs"
layout.exportToPDF(outpath +"\ newmap.pdf", 300)
Below are screenshots of the layout on ArcGIS pro, and on the exported pdf.
enter image description here In ArcGIS pro
enter image description here In pdf

Related

Convert - GLTF/STL/OBJ file formats to U3D file for PDF page

I am trying to add three.js based 3D objects to a PDF page. It seems there are no direct exporters available to do that. So I am trying to do the below thing,
Convert the gltf/stl/obj files to U3D files
Add the .u3d file to PDF page.
I am trying to do the below process and I am not sure whether this approach is possible. It will be a great help if there is any support available to do any one of the below conversions. Also if you know any other possible approaches, kindly update me!!
Input formats output format
GLTF
OBJ U3D
STL
(any
three.js supported
3D formats)
Thanks.
There are few options available to export the three.js graphics to a PDF ( static content not a dynamic U3D assets)
Static contents
Get the rendered data from the three.js webGL renderer / canvas renderer using toDataURL("image/jpeg"), change the MIME type to JPG/PNG and add the resulting stream as an image to PDF ( this worked for me)
example - https://plnkr.co/edit/Ty8BZaDcflCJH5tH?preview
Like the above approach we can use three.js svgrenderer to export the renderer contents into a SVG data stream, which can be added into the PDF ( textures, mesh may not be 100% reproduced)
The legacy API - "threejs-pdf-renderer" can be used to directly export the three.js animations to a PDF. We don't need any other dependencies to create the PDF. But this is a legacy API which uses legacy three.js version, lot of effort needs to be done to make the API to be compatible with the latest three.js version.
example - https://satheeshks10.github.io/ThreejsPDFGenerator/
Dynamic 3D contents
We can export the three.js animations into a U3D file (no direct support is available as for now), this U3D file can be directly embedded into PDF.
example - https://tetra4d.com/pdf-samples/

Is there any examples on how to export the final visualization as a static map or an animated video in kepler-gl?

Using kepler.gl, a user can drag and drop a CSV or GeoJSON file into
the browser, visualize it with different map layers, explore it by
filtering and aggregating it, and eventually export the final
visualization as a static map or an animated video.
It's clearly should be possible (repo on Github).
On the kepler.gl interface, there's a button to export static plots as images. As far as I can tell, there is no option for video or gif export for animated videos. A screen recorder might be a workaround.
kepler.gl image export
The feature to download animated video or GIF doesn't exist at the time of writing this answer. However, you may follow the below mentioned issues raised on Kepler's Github repo where people have raised similar requests:
Export to video
Export to GIF

Colorbox image effects not showing

I am new to drupal and just wanted to work on a image gallery. For this I downloaded colorbox module and installed it. Created a new content type Gallery with Field Type image and Format colorbox in Manage Display section. Basically I am following this tutorial :
Create gallery in D7
I added content to content type Gallery. But when I click on the images, it does not show any effects, instead a normal image view , ie image in a new window ! Whats wrong I am doing?
Do you install module Libraries API?
Download plugin and unpack to sites/all/libraries/colorbox

export dojo chart to pdf or some other vector format

I need help with exporting dojo charts to pdf. How could i export dojo chart like this one to pdf or some other vector formats? i tried to use this but i can't make it work. Any vector format (ie. svg) works for me! also, i tried to use this example, but don't know what to do.
Can somebody help me!!!
Thanks!
I too was trying to export a dojo chart to pdf.
I tried to use toSvg function of dojox gfx utils then sent the svg stream to server and used apache's Batik for generating the image or pdf.
This works great, except that i am not able export the chart labels.
I tried to do this, with the chart you had shared (http://www.hiim.unizg.hr/mihovil/dojo/dojo.html) and it export had worked well exept the labels again.
Let me know, the exact problem you are seeing.
Thanks,
Srilatha.
You have to set the property of the dojox chart htmlLabels to false and then you can get the svg with:
var def = dojox.gfx.utils.toSvg(chart.surface);

Export SVG elements to PDF?

I have a visualization generated by d3 (a javascript visualization library similar to Protovis or Raphael, which draws stuff using SVG elements). The vis is interactive, so the user can interact with and edit it. Once the user is satisfied with his/her visualization, I would like the user to be able to export this visualization as a PDF. I've tried several HTML to PDF libraries and they don't work with SVG elements.
It is okay if the solution is either client side or server side. I'm using PHP server side but Python or Java implementations might also work.
Browser support: Ideally it would support all modern browsers, but minimally I'd like to support latest versions of both Firefox and webkit browsers.
I do not know of any strong PDF libraries on the client side.
A quick possible way would be to send the svg content to a server, and use something like batik for java to turn the svg to pdf and then send the response to the client again.
Here is a related SO for the converstion.
There's also wkhtml2pdf, which can render anything webkit can as a PDF. If you want to render a combination of SVG and HTML, or want to have some JavaScript run before the PDF snapshot is taken, it's great for that.
http://code.google.com/p/wkhtmltopdf/
PhantomJS can also rasterize url/html to PDF. Same backend (QTWebKit) with wkhtml2pdf.
I did not try d3, but I achieved the effect you are looking for like this in Python3.6:
# Pdf library
from reportlab.pdfgen import canvas
from reportlab.graphics import renderPDF, renderPM
# Svg library
import svgwrite
# Svg to reportlab
from svglib.svglib import svg2rlg, SvgRenderer
# Xml parser
from lxml import etree
# Create the svg
dwg = svgwrite.Drawing('test.svg', profile='tiny')
dwg.add(dwg.line((0, 0), (10, 10), stroke=svgwrite.rgb(10, 10, 16, '%')))
dwg.add(dwg.text('Test', insert=(0, 0.2)))
# Create canvas for pdf
c = canvas.Canvas("output.pdf")
# Parse the xml of the svg
parser = etree.XMLParser(remove_comments=True, recover=True)
root = etree.fromstring(dwg.tostring())
# Render the svg itself
svgRenderer = SvgRenderer()
drawing = svgRenderer.render(root)
# Now render the drawing in the pdf
renderPDF.draw(drawing , c, 10, 10)
# End page and save pdf file
c.showPage()
c.save()
# Or render to a seperate png
renderPM.drawToFile(drawing, "file.png", fmt="PNG")
Reportlab is an open source pdf library and svglib is a library that is able to convert svg's to reportlab Drawings. Rendering svg's directly from the xml is not supported out of the box, that is why I use the SvgRenderer.