Giter Club home page Giter Club logo

Comments (4)

Majklas avatar Majklas commented on August 14, 2024

Hey,
how does it work? I can ee in DHL documentation there're only few params: EPLS2 ZPL2 and PDF.

from dhl-api.

vivzon avatar vivzon commented on August 14, 2024

from dhl-api.

Majklas avatar Majklas commented on August 14, 2024

I had to include
use DHL\Datatype\GB\Label;
and afterwards
`$shipment->LabelImageFormat = 'PDF'; // thermal ZPL2 arba EPL2

$shipment->Label->LabelTemplate = '8X4_PDF'; // 6X4_PDF`

make sure you're having this class in DHL/Entity/GB/ShipmentRequest.php
'LabelTemplate' => array( 'type' => 'LabelTemplate', 'required' => false, 'subobject' => false, 'comment' => 'LabelTemplate', 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_PDF,8X4_PDF,6X4_thermal,8X4_CI_PDF,8X4_CI_thermal', ),

from dhl-api.

naruone avatar naruone commented on August 14, 2024

I had to include
use DHL\Datatype\GB\Label;
and afterwards
`$shipment->LabelImageFormat = 'PDF'; // thermal ZPL2 arba EPL2

$shipment->Label->LabelTemplate = '8X4_PDF'; // 6X4_PDF`

make sure you're having this class in DHL/Entity/GB/ShipmentRequest.php
'LabelTemplate' => array( 'type' => 'LabelTemplate', 'required' => false, 'subobject' => false, 'comment' => 'LabelTemplate', 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_PDF,8X4_PDF,6X4_thermal,8X4_CI_PDF,8X4_CI_thermal', ),

this is my code

     $xmlCreate = new DHL\Entity\GB\ShipmentRequest();
     // Omit
    $xmlCreate->LabelImageFormat = 'PDF';
    if ($data['LabelImageFormat'] == 'PDF_Thermal') {
        $xmlCreate->Label->LabelTemplate = '8X4_PDF';
        $xmlCreate->Label->Logo = 'N';
        $xmlCreate->Label->Resolution = '300';
    } else {
        $xmlCreate->Label->LabelTemplate = '8X4_A4_PDF';
        $xmlCreate->Label->Logo = 'N';
        $xmlCreate->Label->Resolution = '300';
    }`

I modified 'Datatype//Label' (all of them) according to the above. I can support 64_pdf, 8*4_pdf, the above is my code, the middle part is omitted.

from dhl-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.