Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Using PDF reDirect
 EXP Systems Forum : PDF reDirect : Using PDF reDirect
Topic: Some PDF Mirrored Post Reply Post New Topic
Author Message
AmosNZ
Newbie
Newbie


Joined: 24 Feb 14
Location: New Zealand
Posts: 4
Quote AmosNZ Replybullet Topic: Some PDF Mirrored
    Posted: 25 Feb 14 at 3:01AM
I've found an unusual error during our testing of PDF reDirect, but I'm not sure where the problem is.  PDF reDirect prints fine from our application when we choose file > print etc, but the problem occurs when we schedule a print job through our automation applet.  The problem did not occur using the applet when using the previous pdf printer (ppf995).

Here is are examples of each.
http://users.on.net/~amosau/EXP/
As you can see, the AutomationServer print mirrors the text boxes upside down, but the label items remain correct.

I've spoken to our software provider and he's passed on this info:

-------
There is a “y reversal” happening in the mapping modes currently in use.
This appears to be getting handled correctly by other pdf writers, and by all screen and printer drivers we’re aware of.
So I think PDF Redirect’s handling of this situation is out of step with Windows definitions.

Specifically we are doing these calls internally setting up the CDC mapping modes…

       // Note: the reversal in y is happening in QPageView::PrepareDCNoOrigin which does this
       //            pDC->SetMapMode(MM_ANISOTROPIC);
       //            pDC->SetWindowExt(UNITSPERMETRE, UNITSPERMETRE);
       //            pDC->SetViewportExt(cxx, -cyy); // reverse y

….where UNITSPERMETRE is 10000

Note that for world to screen mappings which reflect the y coordinate, text is *not* inverted in the MM_ANISOTROPIC mode, but it would be if we were using GM_ADVANCED (which we may change to at some point).
This lack of reversal of text in this mode is in effect a peculiarity of Windows and may not be being handled correctly in their PDF Redirect CDC mode logic.
-------

None of that makes sense to me, but does it help pinpoint where our issue might be occurring?

Thanks
Paul

Edit: forgot to add url.
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 26 Feb 14 at 6:32AM
Hi,
Thanks for the technical details: it helps. I will get back to you shortly.

Cheers!

Michel


Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 27 Feb 14 at 6:19AM
Hi Paul,

    I went through the code that your software engineer, as well as his comments. The code he makes reference to are for the coordinate system, reversing the value of "y" so that the objects are displayed down the page rather than off the page, so no issues there: I agree with his assessment.

   He also points the finger as the source of the issue to be the PDF reDirect printer driver behaviour which is different than in other products - which may be the case. PDF reDirect uses the generic postscript printer driver distributed with Windows, and published by a joint effort between Microsoft and Adobe. Therefore, I do not have access to the source code, and cannot make any changes myself.

   Here is the good news (perhaps). Microsoft issued a new version which I incorporated in the new version of PDF reDirect, which I have available as a beta version (and frankly, seems to work fine - no bug reports). You can try that version if you would like to see if that addresses the problem.

   Admittedly, this is a complete shot in the dark, with no promises that it will fix the problem, but it is worth trying. If it does not, there is very little that I can do. Your programmer could add code to flip the text when it prints to PDF reDirect though.

   You can get PDF reDirect v2.5.4 here:
span>

    I hope this helps,

Michel
Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
AmosNZ
Newbie
Newbie


Joined: 24 Feb 14
Location: New Zealand
Posts: 4
Quote AmosNZ Replybullet Posted: 27 Feb 14 at 3:01PM
Hi Michel

Thanks for the very prompt reply!
Unfortunately I have already spied the 2.5.4 beta on another thread and have tried that with the same results.  I have also tried several different conversion engines in case that was the issue but nothing corrected it.

I'll take this info back to the developer and see what he says.

I've trialled a bunch of different pdf printers over the last couple days and only found 1 other that meets our criteria (because this prints from an unattended machine we need auto naming and auto appending with no user interaction), and your interface is much nicer.

Thanks for looking into it.
Paul

IP IP Logged
AmosNZ
Newbie
Newbie


Joined: 24 Feb 14
Location: New Zealand
Posts: 4
Quote AmosNZ Replybullet Posted: 27 Feb 14 at 4:25PM
Hi Michel
I've spoken to the dev this morning and he says:
--------------------
It is not an easy matter to change the text box drawing code because it uses text wrapping logic inside the Windows GDI to fill the box etc etc... a lot is done by the CDC Windows internals here. And also not easy to unflip the coordinates... again it is Windows itself forcing this behaviour because y=0 is at the top of a Window but all of our graphics calls use a mathematical regular coordinate system which has origin at bottom left.

There is definitely a bug to be fixed here, and it is either fixed already (give it a try as he suggests) or can be reported to Windows developer team.
-----------------
As I've already tried the beta version with no change we'll report the bug to MS to correct.

Thanks
Paul
IP IP Logged
AmosNZ
Newbie
Newbie


Joined: 24 Feb 14
Location: New Zealand
Posts: 4
Quote AmosNZ Replybullet Posted: 02 Mar 14 at 5:47PM
Hi Michel

One last question.  Is it the pscript5.dll and ps5ui.dll files that are responsible for the postscript conversion and thus responsible for the issue I'm seeing?

The system is still running windows XP, but I notice the version of these .dll files is win7sp1_rtm so I'm guessing they have been installed via a service pack.  Is it worth trying to replace these 2 files with windows 8 x86 versions?
Is there any other files I'd need to replace?

Thanks
Paul

IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet Posted: 05 Mar 14 at 6:33AM
Hi,

Those are the Microsoft printer driver files, that take the raw printer data, and convert it to a Postscript file. Yes, it is possible that they are the source of the problem.

They are a later version because PDF reDirect installed the latest version as part of the installer. You could try downloading and installing an older version of PDF reDirect (see the download page).

You can certainly try manually replacing them, but it might be tricky. As a minimum, turn off the Windows Print Spooler service, change the files, and then restart the service. Otherwise, your computer may crash. I am also not sure that it will work properly without doing a proper install.

Cheers!
Michel Korwin-Szymanowski
EXP Systems LLC
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum