#1 2016-01-21 16:21:12

jeanmilost
Member
Registered: 2016-01-21
Posts: 35

How to change the TPdfCanvas origin?

Hello,

In a TPdfDocument, the TPdfCanvas origin is located on the left and bottom of the page, whereas the TCanvas is located on the left and top. I need that the both origins are the same, on the left and top of the document. So is there a way to move the TPdfCanvas origin to the left and top of the document?

Regards

Offline

#2 2016-01-21 17:42:53

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: How to change the TPdfCanvas origin?

The TPdfCanvas follows the PDF canvas orientation, which is not the TCanvas orientation...
This is by design of the PDF format itself.
See http://www.verypdf.com/document/pdf-for … g_0199.htm

Offline

#3 2016-01-21 18:34:36

jeanmilost
Member
Registered: 2016-01-21
Posts: 35

Re: How to change the TPdfCanvas origin?

Hi ab,

Thank you for the response.

Ok that what I thought. So I have no alternative but to convert manually all the coordinates from a system to other if I use the both canvas together.

But is that possible to add a such property in the PDF engine in the future?

Regards

Offline

#4 2016-01-21 22:16:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: How to change the TPdfCanvas origin?

Why not use the TCanvas?

Offline

#5 2016-01-22 00:16:28

jeanmilost
Member
Registered: 2016-01-21
Posts: 35

Re: How to change the TPdfCanvas origin?

Hi ab,

In fact, this is dependent to the response to my other posts :-). If I can use the Windows DrawText() functions without problems, including for Hebrew and Arabic texts, then yes, using the VCLCanvas alone will be the best solution. Unfortunately, I tried to draw some texts in different languages using VCLCanvas in association with the Windows text functions, and the result was incorrect. I know that is not a problem with my drawing functions because the exactly same code generates a correct result on my screen but not in the PDF document. I tried to play with some properties as e.g. UseUniscribe, without success. The only solution I found until now to generate the correct output texts in Hebrew or Arabic was to use the TPdfCanvas TextOut() function.

In conclusion, if I can find a way to draw all my texts correctly using a VCLCanvas, then yes, I will use it to draw all my document, that's what I want in fact. But in case I cannot, my only alternative is either to draw all my document using TPdfCanvas, in this case I must revise all my drawing engine, or mixing the both canvas, in this case I must manage the different origins, in addition to the problems of text positioning, cropping and word wrapping.

Because I work for a company that requires the support of those languages, I need to have the absolute certainty that my text will be drawn correctly regardless of the language. However I continue to search why my text isn't generated correctly using a TCanvas. I really pray to find an acceptable solution, because this library provides many facilities that I really like.

Regards

Offline

Board footer

Powered by FluxBB