1

私がこのような表面を作ったとしましょう:

cairo_surface_t* surface = cairo_pdf_surface_create("pdffile.pdf", 40000, 40000);
cairo_t* cr = cairo_create(surface);

それは大きな表面です!そうする理由は、プロットするまで図面のサイズがわからないためです(これは複雑なグラフであり、その場で生成されます)。プロットした後、表面をトリミングするのは非常に簡単なようです。では、どうすればよいですか?

4

1 に答える 1

2

Draw to a recording surface instead of a PDF surface. The recording surfaces can then be painted to a smaller PDF surface. Also, cairo supports unbounded recording surfaces, so this would even work when your drawing is wider/higher than 40k pixel.

于 2012-06-22T21:15:52.583 に答える