Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How to export as a PDF?

$
0
0

I've created a styled map using tilemill and unfolding maps and now want to export/save it as a pdf. Here's the code I've tried, however the pdf is saving as blank. Can someone help me as to where I am going wrong?

import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.data.*;
import de.fhpotsdam.unfolding.events.*;
import de.fhpotsdam.unfolding.geo.*;
import de.fhpotsdam.unfolding.interactions.*;
import de.fhpotsdam.unfolding.mapdisplay.*;
import de.fhpotsdam.unfolding.mapdisplay.shaders.*;
import de.fhpotsdam.unfolding.marker.*;
import de.fhpotsdam.unfolding.providers.*;
import de.fhpotsdam.unfolding.texture.*;
import de.fhpotsdam.unfolding.tiles.*;
import de.fhpotsdam.unfolding.ui.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.utils.*;
import processing.pdf.*;

UnfoldingMap currentmap;


String[] paths;

void setup() {
 size(500,500,PDF, "filename.pdf");


  processData();

  MapUtils.createDefaultEventDispatcher(this, currentmap);
currentmap.zoomAndPanTo(891f, 234f,7);

}

void processData() {
  String mbTilesString = sketchPath("data/small.mbtiles");
  currentmap = new UnfoldingMap(this, new MBTilesMapProvider(mbTilesString));
}



void draw() {
  currentmap.draw();
  // Exit the program
  println("Finished.");
  exit();
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles