Skip to content

Instantly share code, notes, and snippets.

@kylejohnston
Created September 29, 2018 05:26
Show Gist options
  • Select an option

  • Save kylejohnston/1476a4d8055c9486cf3f04dc9fd4a6e6 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnston/1476a4d8055c9486cf3f04dc9fd4a6e6 to your computer and use it in GitHub Desktop.
Sublime snippet for generating PDFs from Processing + HYPE PDEs
<snippet><content><![CDATA[
// MOVE TO LINE 1
import processing.pdf.*;
// PLACE BEFORE CLOSING BRACE IN VOID SETUP()
saveVector();
noLoop();
} // CLOSE VOID SETUP()
void draw() {
H.drawStage();
}
void saveVector() {
PGraphics tmp = null;
tmp = beginRecord(PDF, "#####.pdf");
if (tmp == null) {
H.drawStage();
} else {
H.stage().paintAll(tmp, false, 1); // PGraphics, uses3D, alpha
}
endRecord();
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>hype_pdf</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.pde</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment