Question
Help me to convert svg to pdf in the script
dear all,
i need to modify this script of saving svg to pdf can anybody help me
- function filesToArtboards() {
- // My function variables…
- var doc, fileList, i, inFolder, mm, svgFile;
- // Get the user to select a folder
- inFolder = Folder.selectDialog( 'Please choose your Folder of files to place…' );
- // Check they ain't cancelled
- if ( inFolder != null ) {
- // Gets just the SVG files…
- fileList = inFolder.getFiles( /\.svg$/i );
- // Make sure it has AI files in it…
- if ( fileList.length > 0 ) {
- mm = 2.83464567 // Metric MM converter…
- // Set the script to work with artboard rulers
- app.coordinateSystem =
- CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
- // Add new multi-page document
- doc = app.documents.add(
- DocumentColorSpace.RGB,
- width = 148.5*mm,
- height = 210*mm,
- numArtboards = fileList.length, // The number of SVG files
- DocumentArtboardLayout.GridByCol,
- artboardSpacing = 20*mm,
- artboardRowsOrCols = Math.round( Math.sqrt( fileList.length ) )
- );
- // Loop thru the counter
- for ( i = 0; i < fileList.length; i++ ) {
- // Set the active artboard rulers based on this
- doc.artboards.setActiveArtboardIndex( i );
- // Create group from SVG
- svgFile = doc.groupItems.createFromFile( fileList );
- // Move relative to this artboards rulers
- // Top Left
- sgvFile.position = [ 0, 0 ];
- };
- };
- };
- };
- filesToArtboards();
i want to modify this code that it has to save as pdf , because we will save svg file as pdf by pressing (shift+o) artboard selection and we choose landscape and save as A4 format as pdf with same file name can anybody modify this script .
