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 6867759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:20:59+00:00 2026-05-27T03:20:59+00:00

I am using ABCPDF to print a PDF file to a local printer via

  • 0

I am using ABCPDF to print a PDF file to a local printer via EMF file. I’ve based this very closely on ABC PDF’s sample “ABCPDFView” project. My application worked fine on my Windows 7 and Windows XP dev boxes, but when I moved to a Windows 2003 test box, simple embedded fonts (like Times New Roman 12) rendered completely wrong (wrong spot, and short and squat, almost like the DPI’s were crazily wrong).

Note that I’ve hardcoded the DPI to 240 here b/c I’m using a weird mainframe print driver that forces 240×240. I can discount that driver as the culprit as, if I save the EMF file locally during print, it shows the same layout problems. If I render to PNG or TIFF files, this looks just fine on all my servers using this same code (put .png in place of .emf). Finally, if I use the ABCPDFView project to manually add in a random text box to my PDF, that text also renders wrong in the EMF file. (Side note, if I print the PDF using Acrobat, the text renders just fine)

Update: I left out a useful point for anyone else having this problem. I can work around the problem by setting RenderTextAsText to “0” (see code below). This forces ABCPDF to render the text as polygons and makes the problem go away. This isn’t a great solution though, as it greatly increases the size of my EMF files, and those polygons don’t render nearly as cleanly in my final print document.

Anyone have any thoughts on the causes of this weird font problem?

private void DoPrintPage(object sender, PrintPageEventArgs e)
  {
      using (Graphics g = e.Graphics)
      {
        //... omitted code to determine the rect, used straight from ABC PDF sample
          mDoc.Rendering.DotsPerInch = 240 ;
          mDoc.Rendering.ColorSpace = "RGB";
          mDoc.Rendering.BitsPerChannel = 8;
          mDoc.SetInfo(0, "RenderTextAsText", "0");//the magic is right here
          byte[] theData = mDoc.Rendering.GetData(".emf");
          using (MemoryStream theStream = new MemoryStream(theData))
          {
              using (Metafile theEMF = new Metafile(theStream))
              {
                  g.DrawImage(theEMF, theRect);
              }
          }
          //... omitted code to move to the next page
      }
  • 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-05-27T03:21:00+00:00Added an answer on May 27, 2026 at 3:21 am

    I was originally RDPing in with 1920×1080 resolution, by switching to 1024×768 res for RDP, the problem went away. My main program runs as a service, and starting this service from an RDP session w/ 1024×768 fixes it.

    I have an email out w/ ABC PDF to see if they can explain this and offer a more elegant solution, but for now this works.

    Please note that this is ABC PDF 7, I have no idea if this issue applies to other versions.

    Update: ABC PDF support confirmed that its possible the service is caching the display resolution from the person that started the process. They confirmed that they’ve seen some other weird issues with Remote Desktop and encouraged me to use this 1024×768 workaround and/or start the service remotely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using abcPDF 7 to convert HTML to PDF. This is done via
I am using Websupergoo's ABCpdf for ASP.NET and I am trying to generate PDF's
I'm using ABCpdf to extract the text content of some PDF files, in particular
I'm using the ABCpdf.net component to convert HTML to PDF. Some of the HTML
I've got a project where I'm using a PDF generator to send a file
I'm using ABCPdf get a pdf from a some HTML code. While I was
I'm dynamically generating a PDF using ABCpdf which contains a table of contents that
We're using the ABCPDF Version 6 component to create PDF's from ASP .NET. The
Using ABCPDF, currently generating pdf's with 1mb files. When we alter the pdf in
Using TortoiseSVN against VisualSVN I delete a source file that I should not have

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.