Extracting block of drawing in dwf file

Hi Guys i am new to aspose CAD.

Is it possible to only capture the block with drawing and save it as PDF?

image.png (4.8 KB)

@EricAce,
Hi.
The answer depends on how to identify this block and how it is stored in the drawing. Please provide the initial file so we can assist.

Hi Oleksii,

I see, i have attached the dwg file in the zip file below. I have also added the PDF after convertion so that you can see the white space that i wanted to remove.

DwgFIle.zip (1.0 MB)

@EricAce,
Hello.
It happens sometimes that EXTMIN and EXTMAX values in the file are not correct. These values are used to calculate the size of the drawing. For this drawing EXTMAX is (68.0000,22.0000,0.0000) thus making some additional empty space to the right of the content. We have UpdateSize method to recalculate the size, please check this example:

string fileName = "617421-1517_03_DWG file.dwg";
using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load(fileName))
{
	cadImage.UpdateSize();

	CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
	rasterizationOptions.PageHeight = 2000;
	rasterizationOptions.PageWidth = 2000;

	PdfOptions options = new PdfOptions();
	options.VectorRasterizationOptions = rasterizationOptions;
	
	cadImage.Save("output.pdf", options);
}