Convert pdf into png with transparent background

I have a pdf containing vectors in the first page. I need to convert it into png with transparent background. Is it possible to do this with either Aspose.Words or Aspose.PDF?
Also, I need to generate the png with certain width and height in pixels.
Any example will be appreciated. It is for .NET btw. Thanks!

@pdfmaster

Would it be possible for you to share your sample PDF file for our reference? We need to investigate these requirements. We will test the scenario in our environment and address it accordingly.

The pdfs are architectural drawings generated by Autocad. I can’t share client’s document for confidentiality reasons but this one is similar to what I am working on:

https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.newcastle.edu.au/__data/assets/pdf_file/0010/626572/Architectural-Drawings.pdf&ved=2ahUKEwjKg_HImvCCAxWGc_UHHSQtCnU4ChAWegQIERAB&usg=AOvVaw0m0PcXHmFBEdD5fM12Fnfn

I once got the task done by first converting the pdf into svg to extract the vectors with Aspose.PDF and then converting the generated svg into png with transparent background with Aspose.SVG.

It has zero loss of content in the first conversion so it seems to only contain vectors. However, I have to use 2 libraries for this.

I wonder if it is possible to do the same thing with only 1 library without generating intermediate svg file.

Thanks!

@pdfmaster

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-56049

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.

Finally I figured it out using only Aspose.PDF. It is much more simple than I think. Anyway, great library. Thank you.

public static void Convert(string pdfPath, string pngPath, int wPx, int hPx)
        {
            using (Document pdfDocument = new Document(pdfPath))
            {	
                PngDevice pngDevice = new PngDevice(wPx, hPx);
                pngDevice.TransparentBackground = true;

                if (pdfDocument.Pages.Count < 1)
                    throw new Exception("The pdf has no page to convert.");

                using (FileStream pngStream = new FileStream(pngPath, FileMode.Create))
                {
                    pngDevice.Process(pdfDocument.Pages[1], pngStream);

                    pngStream.Close();
                }
            }
        } 

@pdfmaster

You are right. We have also closed this ticket and have taken into account to highlight this feature in the documentation as well as on other important pages so that it can be found easily. In case you have other requirements, please feel free to create a new topic.