How can I make fit the diagram in the page?
Solution 1:
It is not possible to do this natively in Dia.
Being open source software, the feature could be implemented.
There is nothing that technically prevents a PDF from having custom dimensions (but it can't have no dimensions, that goes without saying I think).
Just in case Dia coders are reading this, the way I see the feature implemented would look like this:
- You would still have to select a paper size in Page Setup.
- You would set all margins to zero
- You would then tick a check-box named something like "Crop paper size to fit content"
On export, Dia would first scale the image to best fit the paper size, then adjust the paper size in one dimension to eliminate remaining empty space, then perform the render to PDF.
Who wants to implement this? If I had the coding expertise I would, because frankly this would be an excellent feature which I'd use myself too.
Solution 2:
There is currently no way to do it in Dia natively. But it can be done in two simple steps:
- Export the diagram to EPS (Encapsulated PostScript (using Pango fonts)) to get borderless vector graphics
- Convert EPS to PDF:
epstopdf mydiagram.eps
epstopdf is part of most TeX distributions.
Solution 3:
The simplest way to do this is (in Linux anyway) is to use Page Setup to fit the page to 1 x 1, then Print -> Print to file, and print it as PDF. The resulting PDF will be a single page document.