Moving from PDF Converter to PDF Creator

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
watcher2014
Posts: 5
Joined: Sun Aug 17 2014

Moving from PDF Converter to PDF Creator

Post by watcher2014 »

Hi,

We are trying to move from PDF Converter to PDF Creator but we encounter some strange side effects.

The current situation is : we are using PDF Converter as a standalone PDF printer. We are sending commands(text, line, bitmaps) to the printer PDF using C# printing system like to any other real printer. Everything works fine in this case.

Our expectations were that printing a text to PDF Converter is similar with Adding a text to PDF Creator. But we had a big problem with positioning. After some tests we multiply all text coordinates with 14.17 and things look better but it seems that is a margin top and margin left applied in the PDF Converter.



any help will be highly appreciated.
Alexandre
Amyuni Team
Posts: 21
Joined: Tue Oct 01 2002
Contact:

Re: Moving from PDF Converter to PDF Creator

Post by Alexandre »

Hello,

PDFCreator functions work with coordinates in “twips” (1/1440 of an inch). You can set a page’s margins in PDFCreator though page object’s attributes like “LeftMargin”, “RightMargin”, etc http://amyuni.com/WebHelp/Amyuni_PDF_Cr ... ibutes.htm

Your code that is printing to PDFConverter is most likely using GDI/GdiPlus/System.Drawing abstract “logical units”, whose conversion to final twips depends on several factors, such as:
  • Regular GDI/GdiPlus/System.Drawing coordinate transform mechanisms such as Graphics.ScaleTransform, GDI’s SetWorldTransform,etc.
  • Your current PDFConverter configuration for margins and scaling
In order for you to adapt your code from PDFConverter to PDFCreator, you need to convert your units to twips depending on those factors.

Thanks.

Alex
watcher2014
Posts: 5
Joined: Sun Aug 17 2014

Re: Moving from PDF Converter to PDF Creator

Post by watcher2014 »

Hi Andre,

Your point with twips improved help me to improve the result a lot. I found on net that 1 pixel = 15 twips.

Now I have another question... When I print a text with font
Arial 16
- Converter produce Arial 16.08
- Creator produce XYFQTA + Arial 16.00

Arial 14
- Converter produce Arial 13.92
- Creator produce XYFQTA + Arial 14.00

What is that XYFQTA and why it changing the font size with 0.08 + or -
Alexandre
Amyuni Team
Posts: 21
Joined: Tue Oct 01 2002
Contact:

Re: Moving from PDF Converter to PDF Creator

Post by Alexandre »

Hello Watcher,

1 pixel = 15 twips, it's not always correct, it depends on screen resolution.

XYFQTA - it is a prefex that's added to track fonts in a PDF file.

Question: how you get font sizes, for example 16.08 and 16.00?
watcher2014
Posts: 5
Joined: Sun Aug 17 2014

Re: Moving from PDF Converter to PDF Creator

Post by watcher2014 »

"1 pixel = 15 twips, it's not always correct, it depends on screen resolution."
Corect I found that my magic scale value is 14.4

Ok so the prefix part is not a problem.

I'm using obj.Attribute("TextFont").Value where obj is a IacObject of type text.
Alexandre
Amyuni Team
Posts: 21
Joined: Tue Oct 01 2002
Contact:

Re: Moving from PDF Converter to PDF Creator

Post by Alexandre »

Can you send me these pdfs, produced by Converter and Creator and how you created them (original file if exist, maybe some code snippets).
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Re: Moving from PDF Converter to PDF Creator

Post by Jose »

Hello,

Twips are screen-independent units and a twip is 1\20 th of an inch point.

You can find more information about TWIPS from the Microsoft KB below.
http://support.microsoft.com/kb/76388

Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
Post Reply