Menu

#4 addText problem

open
nobody
None
5
2019-09-10
2006-03-21
Anonymous
No

1. I have installed successfully sharpPdf v.2 beta 2
(release).
2. I attempt to use this pdf from scratch. When using
of the addText method of the pdfPage I got the
problem:

I wrote:
pdfDocument doc = new pdfDocument("Title","Boris");

pdfPage pg = doc.addPage
(sharpPDF.Enumerators.predefinedPageSize.csA4Page);

?????????????
pg.addText("Text to write",50,50,?????,22);

Which object I have to define and put instead ?????
(pdfAbstractFont or pdfPredefinedFont or anything
alse)?
When I attempt put pdfPredefinedFont,csHelvetica (as
written in the tutorial), I, of course get compiler
error.

The documentation doesn't help!! it is vey short and
explain nothing!
Thank you very much.
Boris

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Put something like the following:

    myPage.addText("Hello World!", 200, 450,
    myDoc.getFontReference
    (sharpPDF.Enumerators.predefinedFont.csHelvetica), 20)

     
  • Gustavo Salatino

    Logged In: YES
    user_id=1194940
    Originator: NO

    Boris, try this with the font problem:
    pg.addText("Text to write",50,50,doc.getFontReference(pdfPredefinedFont,csHelvetica),22);

    You're right, the documentation is short. But you may think that it's a free open source project... so, please be patient ;-)

     
  • madhur

    madhur - 2019-09-10

    Hello All, i am using the Sharp pdf with Unity3d but me facing some issues can anyone help me out, here are the questions :-
    1. How to dynamically increase the column height according to the text size at runtime.
    2. How do i insert an image without using the co-routine function.
    3. How to dynamically write the data on the new page if current page is filled and data is still pending. For example, there are 50 rows in my table at runtime and one first page 30rows occupy the space, then how do i dynamically write the remaining 20 rows on second page.
    4. Instead of storing the file in root folder, in assets folder , how can i store the pdf at different location by selecting the folder from the system.
    5. How do i add font to text nd paragraph with latest download.
    Can anyone please help me out, it would be great help....Thank you in advance.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.