Module: Asposepdfjava::PdfToSvg

Defined in:
lib/asposepdfjava/Converter/pdftosvg.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/asposepdfjava/Converter/pdftosvg.rb', line 3

def initialize()
	# The path to the documents directory.
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Open the target document
    pdf = Rjb::import('com.aspose.pdf.Document').new(data_dir + 'input1.pdf')

    # instantiate an object of SvgSaveOptions
    save_options = Rjb::import('com.aspose.pdf.SvgSaveOptions').new

    # do not compress SVG image to Zip archive
    save_options.CompressOutputToZipArchive = false

    # Save the output to XLS format
    pdf.save(data_dir + "Output.svg", save_options)

    puts "Document has been converted successfully"
end