Forum Discussion

The_Doc's avatar
The_Doc
Ultimate Cover User
2 months ago

Endpoint - Render Sales Invoices as pdf

Hi Folks

 

Well you have seen my posts on the emailing endpoint and its failures - major faults - I now have to fallback to option 'C' - this endpoint.

 

What it does is takes an item invoice and using either a default form or named designed form - renders this to aa pdf and bitstreams it to you via an http call - I get that working and I get a binary stream of data that appears to be a pdf format - but at this point it all goes to doo doo.

It is a bitstream so saving as text will error - so I save it to file named myob.pdf and though it appears to have some formatting that is pdf and its header says %pdf....   it doesn't open and errors.

I have saved the actual invoice in myob as a pdf and opened it as a text to compare and it isn't the same - so let us 'assume' it is coming to me correctly as a formatted pdf in a binary filestream what am I doing wrong my end that is corrupting it. 

 

I am using MS Access and saving it as a binary filestream but am not having success.

 

Anyone out there use this endpoint and it works - if necessary I can quickly spin up code in VB.Net or C#.Net to download invoices so I can attachment for external emailing -  any urgent help would be appreciated - I just don't have time to muck with this possible solution - as my MS Access code posts the invoices to MYOB anyway so to build an invoice in MS Access which has a very powerful gui designer will be easy and then to save it to pdf is a breeze and email it - no problem using CDO code which goes around outlook.

 

The Doc

 

 

1 Reply

  • The_Doc's avatar
    The_Doc
    Ultimate Cover User
    2 months ago

    Have answered this myself - there doesn't seem to be anyone that has used this endpoint successfully - I gave up - I might try a few other things like decode64 - but cannot think of anything else but anyways - don't need it - have built my own invoices using MS Access very powerful report GUI which leaves MYOB's report gui for dead - and am emailing these out.

     

    See my comments my other posts re the emailing endpoints.

     

    Not a solution - sure - but a workaround which is an essential trait of being an MYOB api developer.

     

    The Doc