Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:14:29+00:00 2026-06-14T07:14:29+00:00

After trying as many possibilities as I can without successful result, here is my

  • 0

After trying as many possibilities as I can without successful result, here is my question regarding with iTextsharp component.
I have a requirement on creating a ticket for which I decided to use the iTextSharp Library.

I have used this library on java & .net projects with fixed length documents without problems but in this case document is variable length. The document is created perfectly and accordingly with the spec. After the PDF is created I use System.Diagnostics.Process with the verb “PrintTo” for send it to the printer. Due to the variable length nature of the ticket it is not adequate to set a fixed paper length on the printer, so I use the following line to instruct the printer to take the document size (accordingly with Manning iText in Action 2nd Edition, page 140) but it seem not to function properly.

writer.AddViewerPreference(PdfName.PICKTRAYBYPDFSIZE, new PdfBoolean(true));

Any ideas on how could I send the document to printer instructing the printer to adjust the paper size to the document size?

Thanks in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:14:31+00:00Added an answer on June 14, 2026 at 7:14 am

    By using GhostScript (GHS) and mswinpr2as printing device we were able to print to practically any printer recognized for the Operative System (Windows).

    To stablish the paper size it is necesary to set the following arguments when invoking GHS command line utility (gswin32c):

    • dFIXEDMEDIA
    • dDEVICEWIDTHPOINTS = value
    • dDEVICEHEIGHTPOINTS = value
    • sOutputFile = “%printer%PRINTER_NAME”
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to parse an nested expressions like GroupParser.parse({{a}{{c}{d}}}) After many hours i have now
This is my first post here after many visits. Hello! I am trying to
im trying to customize this page indicator with half succes, but after many hours
I'm trying to start unicorn_rails in a ruby script, and after executing many commands
After trying this simple console input with 5, the result is shown as 53
After trying to figure how to have an effective word counter of a string,
After trying a lot i decided to ask question on stackoverflow, I create a
I'm trying to use GitHub for the first time, but after many issues trying
I am trying to learn ASP.NET MVC. After reading through many articles on the
After trying many and searching web option to compile and load dll I could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.