0

We are trying to merge multiple images into single pdf document. And convertapi seemed the perfect solution for us. However when I tried a sample with using your api, it returns

{
    "Code": 5999,
    "Message": "The error mapping is missing."
}

And my request is in below, Can you point me to right direction please:

Url: https://v2.convertapi.com/pdf/to/merge?Secret=XXXXXXXXXXXXXXXX

Post Data:

{
    "Parameters": [
        {
            "Name": "StoreFile",
            "Value": "true"
        },
        {
            "Name": "PdfVersion",
            "Value": "1.7"
        },
        {
            "Name": "Files",
            "FileValues": [
                {
                    "Url": "https://vignette.wikia.nocookie.net/gameofthrones/images/5/52/Viserion_brought_down.jpg"
                },
                {
                    "Url": "https://vignette.wikia.nocookie.net/gameofthrones/images/5/52/Viserion_brought_down.jpg"
                },
                {
                    "Url": "https://vignette.wikia.nocookie.net/gameofthrones/images/5/52/Viserion_brought_down.jpg"
                }
            ]
        }
    ]
}
Jonas
  • 4,683
  • 4
  • 45
  • 81
tolgatanriverdi
  • 561
  • 9
  • 31

1 Answers1

0

Conversions can be chained by using result file link as source file in successive conversion. Result file URL will be treated exceptionally and conversion will be processed in high performance. Example:

  1. Convert JPG to PDF

    Request:

    POST https://v2.convertapi.com/jpg/to/pdf?secret=XXX&storefile=true&file=https://example.com/file1.jpg
    

    Result:

    {
      "ConversionTime": 2,
      "Files": [
        {
          "FileName": "file1.pdf",
          "FileSize": 19456,
          "Url": "https://v2.convertapi.com/d/ZYXFNMPT/file1.pdf"
        }
      ]
    }
    

    Request:

    POST https://v2.convertapi.com/jpg/to/pdf?secret=XXX&storefile=true&file=https://example.com/file2.jpg
    

    Result:

    {
      "ConversionTime": 2,
      "Files": [
        {
          "FileName": "file2.pdf",
          "FileSize": 19456,
          "Url": "https://v2.convertapi.com/d/QAZEDCTG/file2.pdf"
        }
      ]
    }
    
  2. Merge result PDF files

    POST https://v2.convertapi.com/pdf/to/merge?Secret=XXXXXXXXXXXXXXXX
    
    {
      "Parameters": [
        {
          "Name": "Files",
          "FileValues": [
             {
                 "Url": "https://v2.convertapi.com/d/ZYXFNMPT/file1.pdf"
             },
             {
                 "Url": "https://v2.convertapi.com/d/QAZEDCTG/file2.pdf"
             }
          ]
        }
      ]
    }
    
Jonas
  • 4,683
  • 4
  • 45
  • 81
  • Thanks but when I try to convert this image it says conversion error, but it opens in web browsers , or in our mobile apps http://lh3.googleusercontent.com/44eoSS05a05f9W_C4jNlnZvrWbvXB6DB5eLOeu4O2Eq7GemfDkqkzo8HX22w7QI-th9eQG4cSGzTaa8JFPWyoQc – tolgatanriverdi Oct 09 '17 at 11:41
  • @tolgatanriverdi could you please try it now? There was a small issue. – Jonas Oct 12 '17 at 07:27