The Graphics and VectorGraphics JavaScript objects, as well as the pcl::Graphics and pcl::VectorGraphics C++ classes, use Qt's QPainter as their back end for low-level painting. As any raster-based painting system, QPainter has limitations:
http://doc.qt.io/qt-5/qpainter.html#limitationsSo it cannot paint outside the [-32767,+32767] range of coordinates in both plane directions. Note that this restriction only applies to the visible viewport, not to the range of usable coordinates, which is the range of 32-bit signed integers. For example, you can draw a line from -100000,-100000 to +100000,+100000 without problems, as long as the intersection with the visible viewport, or visible clipping region, does not exceed [-32767,+32767].
So one solution would be splitting the drawing into several sub-regions smaller than 32767 x 32767 and painting the whole drawing in successive steps, with each sub-region enabled as a clipping region with the VectorGraphics.clipRect property (or with template member function pcl::VectorGraphics::SetClipRect()).
Should work
Edit: Of course, Bitmaps also have size limitations, which in some cases (Windows?) may be OS-dependent. For example, on Linux I cannot create a bitmap with more than 2^29 pixels, or larger than 23170 x 23170 pixels. This seems obvious since a bitmap pixel requires 4 bytes. Again, this limitation could be overcome to paint on a larger image by splitting the drawing into sub-regions.