How to get the vectordata in pdf file(.NET api)

there is a vector grahic pdf file and i want to get the vector data(path,polygon,polyline),such as position,color,linewidth to show on my own canvascontrol . but i didnt find the api to get it . could u help me?

@tao4801653

We have added a new method of working with vector graphics. Try using the following code to detect and extract vector graphics.

var doc = new Document(input);
doc.Pages[1].TrySaveVectorGraphics(outputSvg); 

However, can you please share your sample PDF with expected output data? We will test the scenario in our environment and address it accordingly.

test.pdf (144.0 KB)
thanks for help

it seems like i must export the pdf to svg file. is there any solution that i can get the vector grahic directly by pdf file?

@tao4801653

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54667

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as PDFNET-54667) have been fixed in Aspose.PDF for .NET 24.2.

@tao4801653

We implemented GraphicsAbsorber to get vector data from document.

var doc = new Document(input);
var grAbsorber = new GraphicsAbsorber();
grAbsorber.Visit(doc.Pages[1]);
var elements = grAbsorber.Elements;
var operators = elements[1].Operators;
var rectangle = elements[1].Rectangle;
var position = elements[1].Position;