NetTalk Central

Author Topic: PDF generated reports in landscape.  (Read 6369 times)

lkeyser

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Email
PDF generated reports in landscape.
« on: August 29, 2011, 06:06:06 AM »

My Web Server system works fine on my own workstation to generate reports to
PDF. The problem is that when it is on the web server, the PDF
reports are generated in landscape and the bottom half of the reports are
cut off. Is there something that needs to be deployed to my web host printer drivers or settings ?

The webserver.exe does not use a service account. I even changed it to run under the local admin account.
I have changed the paper size ect.
What causes this. Is this a Adobe Reader 9 issue, printer issue or setup problem ?

Thanks
Louis
 


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: PDF generated reports in landscape.
« Reply #1 on: August 29, 2011, 06:20:02 AM »
Same here. Also I have a Code128 font on a string field on the report which uses the default font when rendered on the client.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: PDF generated reports in landscape.
« Reply #2 on: August 29, 2011, 09:44:41 PM »
Hi Louis,

The key may be the "default printer". Your Clarion report (before it gets converted to a PDF) needs to know which printer it's printing to. Obviously, since no user has changed it, it uses the default printer. A lot of servers don't have any printer installed at all. So first thing to do is make sure the server has a default printer.

Thys;
>> Also I have a Code128 font on a string field on the report which uses the default font when rendered on the client.

If you are using a font in your PDF which the user is not likely to have, then you need to embed the font in the PDF. See your PDF converter docs for more on that.

Cheers
Bruce


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: PDF generated reports in landscape.
« Reply #3 on: August 29, 2011, 10:25:58 PM »
Bruce,

The server has a default printer installed (Microsoft XPS Document Writer) albeit not a physical one. And its default orientation is portrait. Would it then need a printer driver for a physical printer to be installed?

And also, for the font issue: I know you are not the resident Clarion librarian but the only option I got on that control to print Code128 is "Use PDF Font" which presents a fixed (but limited) list of fonts - not conaining Code128. Other than that option, nothing is available to embed the fonts in the PDF file. Any idea?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: PDF generated reports in landscape.
« Reply #4 on: August 29, 2011, 11:43:20 PM »
Hi Thys,

Regarding the Font issue - I think it depends on your PDF tool. Tracker has an option to "Enable Font Embedding". I don't know if the Clarion one has something similar.  Another option you have is to send the barcode into an image control (using Draw, or, I think, standard Clarion) then displaying the image control in your PDF. More work, and it won't scale as well, but it should work.

Regarding the printer - does the report come out ok when you run the server as an Exe (not a service) on the machine?

cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: PDF generated reports in landscape.
« Reply #5 on: August 30, 2011, 01:25:34 AM »
When run as a desktop exe it WORKS as expected. I loaded an HP printer driver - but the service account probably doesn't have this as it's default printer.

What's also great now is that the barcode font is showing like it should. What a change!

How should the service account then be set up?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: PDF generated reports in landscape.
« Reply #6 on: August 30, 2011, 07:49:57 AM »
Not my field exactly, but I think you
Run "services.Msc"
Find your service
right-click, Properties
Set the service to run in a User's account.

There may be other methods, but that's the one I think I recall.

cheers
Bruce


Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: PDF generated reports in landscape.
« Reply #7 on: August 30, 2011, 11:32:08 PM »
Bruce,

I remember now from experience at other clients that the account used for a windows service needs elevated privileges. So when local resources are used in a windows service (like printer access and others) then this account needs to be set up specifically for that. Something to remember in future...

Thanks
Thys

lkeyser

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Email
Re: PDF generated reports in landscape.
« Reply #8 on: August 31, 2011, 02:36:11 AM »
Thanks Bruce. Added a HP 4p printer to default , set to A4 and magic started happening.

Thanks a 1 000 000

Louis.

lkeyser

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Email
Re: PDF generated reports in landscape.
« Reply #9 on: September 01, 2011, 05:27:43 AM »
Problem if you RDP (Remote Desktop) to a server and your resources are set to use local resources (See attached)

It removes yours default printer from the server and sets your local default printer to default in the server. This caused many hours of frustration for me.

Make sure you remove this option from the RDP connection, if you are using mstsc.exe to connect to your server and generating pdf files.


[attachment deleted by admin]