Hello,
I am using the PDF Creator in a custom application written in C++. I am creating a report in the application and am trying to use 2 different font sizes within a page. I am using the following code to change the sizes but the sizes stay the same.
Here is the font for the header:
pdfX->ObjectAttributeStr(wsObject, (WideString)"TextFont", (WideString)"Courier-Bold,10,0,0,0");
And the font for the body of the report:
pdfX->ObjectAttributeStr(wsObject, (WideString)"TextFont", (WideString)"Courier,8,0,0,0");
where wsObject is the name of a Text Object I am trying to modify.
The type face change between the two calls but the font sizes do not change (I think they always print in font size 12). I have tried multiple sizes but the results are the same, always size 12. Is there a different way to change to font size other then using the Text Object attributes?
Change font size
Hello,
Can you send a sample of the PDF document you are using and the name of the object you are trying to modify to support@amyuni.com?
I'll let you know what I find.
Thanks
Can you send a sample of the PDF document you are using and the name of the object you are trying to modify to support@amyuni.com?
I'll let you know what I find.
Thanks
-
- Posts: 4
- Joined: Mon Jan 03 2005
Same problem
Hello!
I have the same problem here with version 2.0 (downloaded 2005-05-03)
I already tried a few different PDFs, fonts, weights and sizes, but I always get 10pt(?) font.
Here is my code:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,14,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
I have the same problem here with version 2.0 (downloaded 2005-05-03)
I already tried a few different PDFs, fonts, weights and sizes, but I always get 10pt(?) font.
Here is my code:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,14,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
-
- Posts: 4
- Joined: Mon Jan 03 2005
-
- Posts: 4
- Joined: Mon Jan 03 2005
finally
Finally: problem solved, but should be fixed within the control!
This does not change font size:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
But this does:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
You just have to set the font size after redrawing the object. Not very pretty, but working. Please fix this!
This does not change font size:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
But this does:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
You just have to set the font size after redrawing the object. Not very pretty, but working. Please fix this!
I received a fix from the support team. You will need to set the text in the object before the the font is set. So in you example:
This does not change font size:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
But this should:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
Give this a try, it worked for my code and should make yours a little cleaner.
This does not change font size:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.RedrawObject s
But this should:
pdf.CreateObject ot, s
pdf.ObjectAttribute(s, "Text") = Trim(Str(pNextElementNumber))
pdf.ObjectAttribute(s, "TextFont") = "Courier,48,1000,0,0"
pdf.ObjectAttribute(s, "LEFT") = xPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "TOP") = yPos - pMarkerSize * 100
pdf.ObjectAttribute(s, "RIGHT") = xPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "BOTTOM") = yPos + pMarkerSize * 100
pdf.ObjectAttribute(s, "STROKEWIDTH") = pMarkerBorder
Give this a try, it worked for my code and should make yours a little cleaner.