首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何获取.ai或.eps文件的属性?

如何获取.ai或.eps文件的属性?
EN

Stack Overflow用户
提问于 2012-09-13 23:12:27
回答 2查看 2.5K关注 0票数 1

我如何才能获得属性的ai (Adobe Illustrator)或eps文件,即分辨率在dpi等。我需要检查这些属性时,上传文件到服务器。

另外,有没有DLL可以将ai/eps转换成标准的图像格式(jpg、gif、png等)?

EN

回答 2

Stack Overflow用户

发布于 2013-03-01 16:18:39

代码语言:javascript
复制
use ImageMagickNET.dll through this you can convert the .ai or .eps files into .jpg format..

c#代码:

代码语言:javascript
复制
  public partial class Form1 : Form
    {

        Process ffmpeg;
        string video;
        string thumb;
        public Form1()
        {
            InitializeComponent();
        }
        private void button4_Click(object sender, EventArgs e)
        {
            ffmpeg = new Process();

            ffmpeg.StartInfo.Arguments = "convert \"" + .ai file path + "\" -background white -flatten -density 300 -colors 512 -antialias  -normalize -units PixelsPerInch -quality 100 -colorspace RGB -resize 3425x3425  \"D:\\GRAPHICS SEARCH ENGINE\\GRAPHICS IMAGES\\AI\\" convert.jpg\"";

            ffmpeg.StartInfo.FileName = ("C:\\Program Files (x86)\\ImageMagick-6.5.3-Q16\\convert.exe");
            ffmpeg.Start();

         }
    }

要获取ai文件的属性,如宽度、高度、页数和标题,请使用itextsharp.dll

代码:

代码语言:javascript
复制
using System;
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Linq; 
using System.Text;
using System.Windows.Forms;
using iTextSharp.text; 
using iTextSharp.text.pdf;

namespace pdfreared { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

    private void button1_Click(object sender, EventArgs e)
    {
        PdfReader reader = new PdfReader(@"D:\Files Formats\Icon.ai");
        int n = reader.NumberOfPages;
        label4.Text = n.ToString();

        // size of the first page
        Rectangle psize = reader.GetPageSize(1);
        float width = psize.Width;
        label1.Text ="Width= " + Convert.ToString(width);
        float height = psize.Height;
        label2.Text = "Height = " + Convert.ToString(height);
      //  reader.Metadata.

        Console.WriteLine("Size of page 1 of {0} => {1} × {2}", n, width, height);
        // file properties
        Dictionary<string, string> infodict = reader.Info;
        foreach (KeyValuePair<string, string> kvp in infodict)
        {
            Console.WriteLine(kvp.Key + " => " + kvp.Value);
            label3.Text = kvp.Key + " => " + kvp.Value;


        }

    }
}
票数 2
EN

Stack Overflow用户

发布于 2016-10-06 12:47:06

使用"identify -verbose image.eps“给出EPS文件和AI文件的元数据信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12409452

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档