Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Jul 19, 2021 2:39 pm

Hello! Can anyone give my a hint on how to extract an SVG from a PDF? I need to extract a SVG BarCode and decode it. Thanks a lot.

BlackBeanChicken
 
Posts: 1
Joined: Thu Jul 15, 2021 9:45 pm

Tue Jul 20, 2021 2:11 am

Hello,

Thanks for your inquiry.
To help us investigate your issue more accurately and quickly, please provide your your input file and your desired output. You could send them to us ([email protected]) via email. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Jul 21, 2021 8:15 am

Hello,
Thanks for your sharing via email.

I tested the following code to convert the pdf file to images and then scanned the generated images, but found that the data matrix could be recognized successfully. If you are not using the latest Spire.Office Platinum(Hotfix) Version:6.7.0, please update to the this version and try again.
Code: Select all
            String file = @"MR69-case1.pdf";

            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(file);

            for (int j = 0; j < doc.Pages[2].ImagesInfo.Length; j++)
            {
                doc.Pages[2].DeleteImage(doc.Pages[2].ImagesInfo[j].Image);

            }
            String fileName = "result.png";
            using (Image image = doc.SaveAsImage(2, 300, 300))
            {
                image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
                String[] result = Spire.Barcode.BarcodeScanner.Scan(fileName);
            }


Besides, please kindly note that data matrix is not supported in the evaluation version. You will need to apply a valid license when scanning this type of barcode. Our sales team just sent you a temporary (one month free) license, please refer to this article (How to Apply the License by license key) to apply your license.

If there are any questions, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Jul 30, 2021 7:15 am

Hello,

Greetings from E-iceblue!
Has your issue been resolved? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF

cron