←Select platform

GetPageSvg(int,CodecsLoadSvgOptions) Method

Summary
Gets an SVG document representation of a page in the PDF file associated with this PDFDocument.
Syntax
C#
C++/CLI
Java
Python
public ISvgDocument getPageSvg(int pageNumber, CodecsLoadSvgOptions options) 
def GetPageSvg(self,pageNumber,options): 

Parameters

pageNumber
1-based number of the page.

options
Options to use when converting the PDF data to SVG. This parameter can be null to use the default options.

Return Value

The Leadtools.ISvgDocument for the specified page.

Remarks

For more information refer to RasterCodecs.LoadSvg.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
using Leadtools.WinForms; 
 
 
public void PDFDocumentGetPageSvgExample() 
{ 
   string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
 
   PDFDocument pdfDocument = new PDFDocument(sourceFileName); 
 
   ImageViewer imageViewer = new Leadtools.Controls.ImageViewer(); 
   imageViewer.ImageBackgroundColor = System.Drawing.Color.White; 
   imageViewer.Location = new System.Drawing.Point(10, 10); 
   imageViewer.Dock = DockStyle.Fill; 
 
   imageViewer.SvgDocument = pdfDocument.GetPageSvg(1, null) as SvgDocument; 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.BufferedWriter; 
import java.io.Console; 
import java.io.File; 
import java.io.FileWriter; 
import java.io.IOException; 
import java.io.OutputStream; 
import java.io.OutputStreamWriter; 
import java.nio.Buffer; 
import java.nio.file.Files; 
import java.nio.file.Path; 
import java.nio.file.Paths; 
import java.nio.file.StandardOpenOption; 
import java.sql.Date; 
import java.text.SimpleDateFormat; 
import java.time.LocalDateTime; 
import java.util.ArrayList; 
import java.util.List; 
 
import javax.xml.validation.Schema; 
 
import org.apache.lucene.store.Directory; 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
import leadtools.pdf.*; 
import leadtools.svg.*; 
 
 
public void pdfDocumentGetPageSvgExample() { 
   String LEAD_VARS_ImagesDir = "C:\\LEADTOOLS23\\Resources\\Images"; 
   String sourceFileName = combine(LEAD_VARS_ImagesDir, "Leadtools.pdf"); 
   String destFileName = combine(LEAD_VARS_ImagesDir, "Leadtools_pdf.svg"); 
 
   PDFDocument pdfDocument = new PDFDocument(sourceFileName); 
 
   SvgDocument svg = (SvgDocument) pdfDocument.getPageSvg(1, null); 
   svg.saveToFile(destFileName, new SvgSaveOptions()); 
   assertTrue(new File(destFileName).exists()); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.