Skip to content

Introduce alternative converter parameter in conversion method #18

Closed

Description

@tomasr78

Activity

  1. laurynas-convertapi commented on Jul 4, 2020

    @laurynas-convertapi
    Contributor

    Implemented in version v1.2.1

  2. tomasr78 commented on Jan 26, 2022

    @tomasr78
    ContributorAuthor

    The alternative converter is not working, how URL is built?

    The URL should look like this using example below

    https://v2.convertapi.com/convert/docx/to/pdf/converter/openoffice

    One of our users complains that if he set converter it is still ignored.

    <?php
    require __DIR__ . '/../lib/ConvertApi/autoload.php';
    
    use \ConvertApi\ConvertApi;
    
    # set your api secret
    ConvertApi::setApiSecret(getenv('CONVERT_API_SECRET'));
    
    # Example of saving Word docx to PDF using OpenOffice converter
    # https://www.convertapi.com/doc-to-pdf/openoffice
    
    $dir = sys_get_temp_dir();
    $upload = new \ConvertApi\FileUpload('files/test.docx');
    
    $result = ConvertApi::convert('pdf', ['File' => $upload, 'converter' => 'openoffice']);
    $savedFiles = $result->saveFiles($dir);
    
    echo "The PDF saved to:\n";
    print_r($savedFiles);
    
    
  3. felixprawira commented on Jan 26, 2022

    @felixprawira

    found the issue, the parameter converter must be in lowercase, while the other parameters can be in first letter uppercase
    image

  4. kostas-jonauskas commented on Nov 1, 2022

    @kostas-jonauskas
    Contributor

    @laurynas-baltsoft customers are complaining about this issue. We need to convert the $params['converter'] to lowercase before appending it to the URL. I cannot see a commit referenced to this issue. Is this fixed already?

  5. tomasr78 commented on Nov 2, 2022

    @tomasr78
    ContributorAuthor

    @laurynas-baltsoft @kostas-baltsoft I think the problem is not how the library appends parameters in lower or uppercase but how it compares. The all-string comparison should be Case-Insensitive and not Case-Sensitive like now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions