Problem with unreadable pdf documents

Discussion forum about all things Team Developer 5.x and 6.x
LarsAke
Sweden
Posts: 8
Joined: 23 Nov 2017, 15:59
Location: Stockholm/Sweden

Problem with unreadable pdf documents

Post by LarsAke » 18 Jan 2018, 16:30

Hi!

We are sending email via smtp server with attached pdf documents which are created with the function SalReportPrintToFileEx and we are using Base64Encode to encode.
Everything worked well from the beginning but a few years ago the pdf documents began to become unreadable and could not be opened with Adobe Reader.
The problem may have something to do with the decoding of the document to do but right now we are sending emails via Outlook as a temporary solution.

Has anyone experienced this and possibly have a solution?

All help is welcome!

Regards
Lars-Åke

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2069
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Problem with unreadable pdf documents

Post by Jeff Luther » 18 Jan 2018, 17:14

Couple thoughts on this:
>> You wrote:
created with the function SalReportPrintToFileEx
And that created PDF file is still readable now?

>> You wrote:
few years ago the pdf documents began to become unreadable and could not be opened with Adobe Reader.
What changed in your system? Upgrade to a newer TD? Maybe upgraded from v4.2 or earlier -- before Unicode was introduced into TD -- to v5.2 or later with Unicode?

>>Could be that you are saving the encoded PDF into a LONG DB column(?) and with TD v5.2 and later a fetch back is being fetched back as a double-byte string and doesn't decode properly?

>> A TEST: How about creating the PDF, encode it, then just decode it and see if Adobe can read it OK.


The key in my opinion to debugging this is to go through each step you take and find out which step causes your code to 'break' -- after SalReportPrint?, after encode?, after decode?, after INSERT then SELECT the encoded file from the DB and decode and try to display?

I strongly suggest you write a small test app with SalReport, encode/decode, etc. so you can find out what broke 'a few years ago.'
Jeff Luther @ PC Design
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/

LarsAke
Sweden
Posts: 8
Joined: 23 Nov 2017, 15:59
Location: Stockholm/Sweden

Problem with unreadable pdf documents

Post by LarsAke » 18 Jan 2018, 18:39

We had not made any changes to our system or program when this problem began to occur and the document is readable before it is encoded and sent with the e-mail and even if it is encoded and decoded and not send by e-mail it is readable.
It seems that it has to do with the receiving system that decodes the message.

Didiman
Germany
Posts: 146
Joined: 21 Mar 2017, 13:05
Location: Bremen, Germany

Problem with unreadable pdf documents

Post by Didiman » 19 Feb 2018, 13:44

JM5C,

you don't need to do the encoding by yourself if you use the SalMail.apl, which ships with SqlWindows.

greetz

--Andreas

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests