litrax
27th June 2018, 16:05
Hello everyone.

I know the topic PDF conversion was discussed a lot.
I already searched the forum for a solution but couldn't find one.

Here is my problem:

I took the idea (amongst others I think Vamsi was the most markable) of an own conversion script instead of ttstpconv to generate PDF files. It works really fine if you do it this way:
ttstpconv --> PS file --> ghostscript --> PDF file
or
some TXT file --> ttstpconv --> PS file --> ghostscript --> PDF file

BUT!

We have some User Fonts in some report layouts.
The reports for customers and suppliers look .... special.
Like bigger font for "Purchase Order" or other things to make the layout and look and feel of the business reports nicer.
Additionaly it could happen that a report layout has eg. UserFont5 but a field within the layout could have UserFont3.
When we print this to a printer the report looks fine, but as soon as we use ttstpconv to TXT, RTF or PS the report looks horrible. So converting to a PDF always needs a special report with NO UserFonts.
That's to know the background...

Now I thought if I make PDF files I want it
1. to look like the ones we print out
2. get rid of extra reports especially for the PDF conversion
Sounds good so far.

So I found a tool called "gpcl6" which is a Ghost PCL to PDF converter.
I used that in my baan conversion script and at a first glance it looked good.
The PDFs really look nearly identical to the print outs.
Now I have a conversion like this:
PCL --> gpcl6 --> PDF

Besides the problem that you cannot copy and paste the text of this PDFs I realised another big problem: We need german umlauts!
But in the files some umlauts are written and others are "hacked" with other letters or cryptic signs.
Further analysis showed that the umlauts are correct in layouts with UserFonts.
And on the other hand umlauts are not correct in layouts without UserFonts. In this layouts Baan uses just Small/Middle/Large for a font height and width definition. But I read somewhere that in this case an ANSI-font is used with the lack of german umlauts! :(

Has someone already had this problem and solved it? :confused:
I want to avoid to edit all layouts of all documents that could possibly be printed via PDF printer and change all this fonts to a UserFont and test it on some devices afterwards to see how it looks!
Is there a possibility to just add a standard font WITH umlauts?

How can I get rid of this problem?
Please advice...

P.S.: When it's all done without errors I post my script in " Code & Utilities" forum.

_

mark_h
28th June 2018, 15:17
Well I do not know enough about ln so this may be way off base. In 4v4 we have print driver files out that there were you could possible go play and change what small/middle/large do. Basically an escape sequence I could play with to change fonts on. I only played with ghostscript once but was told we could not use it. That was years and years ago so not really sure how it works anymore.

bdittmar
28th June 2018, 17:21
Hello,

Using HiDox should solve the Problem.

Maybe try another tool : pcl2pdf

https://www.componentsource.com/product/pcl2pdf-unix/prices

HiDox is full integrated in BIV , LN

Regards

litrax
11th July 2018, 14:12
Thank you for your answers. Finally the answer was so easy as always...

You just have to specify a font in the driver file in $BSE/lib/printinf/<letter>/<driverfile> .
In our driver file there was no specific font for the three print sizes large, middle and small. So I specified a font:

OLD: small=\E(s0p16.67h8.5v0T\E&k7.0H,
NEW: small=\E(12U\E(s0p16.67h8.5v4099T\E&k7.0H,

For now all the details and stuff that have a small font in its report layout defined are printed in Courier. Perhaps I change it sometimes...

But the main problem, that no special font is defined and gpcl takes an ansi font without Umlauts, is solved. Now I have Courier in those layouts and gpcl takes Courier also. WITH Umlauts!


Now the only left disadvantage of pcl2pdf is that the text is not copieable and not searchable! :(

mark_h
11th July 2018, 15:10
Now the only left disadvantage of pcl2pdf is that the text is not copieable and not searchable! :(
Are you saying you cannot search the pdf file it creates?

litrax
11th July 2018, 17:47
Yeah. Its a known issue of gpcl6. Cause pcl was never intended to create a text or pdf file but just to simply print files on a printer. If you want to search a string in this pdf files, than it wont find it. Also you cannot copy text. Tough in my case it's broken.

There might be solution which I don't know yet.
For example I found this tool which says it produces searchable pdfs from pcl:
http://www.visual.co.uk/pcl2pdf.html

If anyone has a solution for this in linux. And pls do NOT suggest any tool to buy ;)

mark_h
12th July 2018, 20:11
I did not know that about ghostscript. Before converting could you use another type format besides PCL? Not sure what formatting differences there might be.

bhushanchanda
13th July 2018, 15:18
Have you tried considering iText library? I have designed several reports with foreign languages using simple Java programs. Just another option. Never tried gpcl.

litrax
17th July 2018, 08:58
Yeah I know. iText is the state of the art converter library. Perhaps I try it out. Infor and many others ( FreePDF I think ) use it too ;)
Look in $BSE/java

Thanks for the help. I'll find a solution now...