在win server 2012R2 .NET上发布ImageMagick-6.9.8-Q16

时间:2017-06-29 08:44:25

标签: .net imagemagick tiff windows-server-2012-r2

从ImageMagick的官方网站下载ImageMagick-6.9.8-Q16后,当我尝试使用此命令将文件.tiff转换为.pdf时收到此错误:

import UIKit
import Social

class ViewController: UIViewController {

@IBAction func buttonAction(_ sender: Any) //Add Storyboard a button
{
    //Alert
    let alert = UIAlertController(title: "Share", message: "Share the poem of the day!", preferredStyle: .actionSheet)

    //First action
    let actionOne = UIAlertAction(title: "Share on Facebook", style: .default) { (action) in

        //Checking if user is connected to Facebook
        if SLComposeViewController.isAvailable(forServiceType: SLServiceTypeFacebook)
        {
            let post = SLComposeViewController(forServiceType: SLServiceTypeFacebook)!

            post.setInitialText("Poem of the day")
            post.add(UIImage(named: "img.png"))

            self.present(post, animated: true, completion: nil)

        } else {self.showAlert(service: "Facebook")}
    }

    //Second action
    let actionTwo = UIAlertAction(title: "Share on Twitter", style: .default) { (action) in

        //Checking if user is connected to Facebook
        if SLComposeViewController.isAvailable(forServiceType: SLServiceTypeTwitter)
        {
            let post = SLComposeViewController(forServiceType: SLServiceTypeTwitter)!

            post.setInitialText("Poem of the day")
            post.add(UIImage(named: "img.png"))

            self.present(post, animated: true, completion: nil)

        } else {self.showAlert(service: "Twitter")}
    }

    let actionThree = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)

    //Add action to action sheet
    alert.addAction(actionOne)
    alert.addAction(actionTwo)
    alert.addAction(actionThree)

    //Present alert
    self.present(alert, animated: true, completion: nil)
}

func showAlert(service:String)
{
    let alert = UIAlertController(title: "Error", message: "You are not connected to \(service)", preferredStyle: .alert)
    let action = UIAlertAction(title: "Dismiss", style: .cancel, handler: nil)

    alert.addAction(action)
    present(alert, animated: true, completion: nil)
}


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
 }
}

error

当我尝试使用.NET程序运行时,此命令无法创建file.pdf

convert -resample 200X200 dir.tif dir.pdf

我该如何解决?

1 个答案:

答案 0 :(得分:0)

您可以忽略它们:

convert image.tif -define tiff:ignore-tags=TAG1,TAG2,TAG3 ...

如果您想先查看忽略的内容,请查看here以搜索TIFF标记。