Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] re: dynapdf command for bookmarks (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] [ANN] 11.0fc1
Next thread: [MBS] re: Number of sysex bytes in a PortMidiEventMBS


Re: [MBS] MBS Real Studio Audio Plugin crash   -   Garth Hjelte
  [MBS] re: dynapdf command for bookmarks   -   Bowerbird aol.com
    [MBS] dynapdf command for bookmarks   -   Bowerbird aol.com
     Re: [MBS] dynapdf command for bookmarks   -   Christian Schmitz
     Re: [MBS] dynapdf command for bookmarks   -   Christian Schmitz
     Re: [MBS] dynapdf command for bookmarks   -   Christian Schmitz

[MBS] re: dynapdf command for bookmarks
Date: 15.01.11 23:03 (Sat, 15 Jan 2011 17:03:22 -0500 (EST))
From: Bowerbird aol.com
christian said;
> Will be fixed in one of the next updates to DynaPDF.

thank you so much! :+)

***

i said:
> i'm using this in the context of "writeftext".
> is there a way to know, on a pagebreak,
> exactly what text was written on that page?

christian (or jens) said:
> Sorry, no. This is not so easy.

ok, i figured the write-routine had to keep track of that,
so it could spit it out... but no problem if it cannot...

> What do you want to do?
> Maybe we can get this done with a different way?

for now, i was just trying to solve the bookmark problem.

but my word, there are so many things that one could do
if one knew what text is on what page, such as indexing...

and it occurs to me that i could probe the text to find out
just exactly how much it would take to fill the output-rect,
by adding words until the height spilled outside of the rect.
(or, for speed, using a binary-search-type probe approach.)

i'll try that out, and let you know what i find.

speaking of speed, the writeftext command is _very_ fast...
blazing. that's why i've been playing around with it so much.

all in all, i am extremely pleased with the dynapdf plugin...

-bowerbird
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

[MBS] dynapdf command for bookmarks
Date: 14.01.11 20:41 (Fri, 14 Jan 2011 14:41:55 -0500 (EST))
From: Bowerbird aol.com
christian-

it appears that the dynapdf bm command
-- for adding a bookmark -- isn't working...

your sample program, slightly modified,
is appended below, as a demonstration...

can you take a look please? thanks.

i'm using this in the context of "writeftext".
is there a way to know, on a pagebreak,
exactly what text was written on that page?
(or what text _still_remains_ to be written?)

if i can know that, i won't need the bm...
(i can use the working bookmark method,
which gives me much more control anyway.)

-bowerbird

dim pdf as new MyDynapdfMBS
dim d as new date
dim text as string
dim height as double
dim TimesBoldHandle as integer
dim TimesHandle as integer

dim f as FolderItem = SpecialFolder.Desktop.Child("Create PDF with text
block fonts.pdf")

pdf.SetLicenseKey "Starter" // For this example you can use a Starter,
Lite, Pro or Enterprise License

call pdf.CreateNewPDF f
call pdf.SetViewerPreferences pdf.kvpDisplayDocTitle,pdf.kavNone
call pdf.SetDocInfo pdf.kdiAuthor, "Christian Schmitz"
call pdf.SetDocInfo pdf.kdiSubject, "My first Realbasic output"
call pdf.SetDocInfo pdf.kdiProducer, "Realbasic test application"
call pdf.SetDocInfo pdf.kdiTitle, "My first Realbasic output"

// We want to use top-down coordinates
call pdf.SetPageCoords pdf.kpcTopDown

call pdf.Append

// load fonts
TimesBoldHandle=pdf.SetFont("Times", pdf.kfsBold, 20.0, true, pdf.kcp1252)
TimesHandle=pdf.SetFont("Times", pdf.kfsItalic, 20.0, true, pdf.kcp1252)

text="In Italic font: Left aligned text, this is left aligned text, this is
" + _
"left aligned text...ju#FC[255]This is justified text, this is " + _
"justified text, this is justified text, this is justified text, this " + _
"is justified text, this is justified text, this is justified text, " + _
"this is justified text...re#FC[165536]This is right aligned text, " + _
"this is right aligned text, this is right aligned text..." + _
"le#FC[233512]Back to left aligned text, we go back to left " + _
"aligned text... FT["+str(TimesBoldHandle)+"]Now we use bold text." + _
chr(13)+"BM[this should add a bookmark...] "+chr(13) +_
"...but the 'bm' command doesn't work for me..."

call pdf.SetTextRect(50, 50, 150, -1)
call pdf.WriteFText(pdf.ktaLeft, text)
height = pdf.GetPageHeight - pdf.GetLastTextPosY - 50
call pdf.Rectangle( 50, 50, 150, height, pdf.kfmStroke)

dim bmk as integer
bmk=pdf.addbookmark("but this method works", -1, 1, true)

call pdf.EndPage

call pdf.Append
TimesBoldHandle=pdf.SetFont("Times", pdf.kfsBold, 20.0, true, pdf.kcp1252)
TimesHandle=pdf.SetFont("Times", pdf.kfsItalic, 20.0, true, pdf.kcp1252)
text=replaceall(text,"this","xxxx")
text=replaceall(text,"is","ii")
text=replaceall(text,"back","bbbb")
call pdf.WriteFText(pdf.ktaLeft, text)
bmk=pdf.addbookmark("bookmark for page 2", -1, 2, true)
call pdf.EndPage

call pdf.CloseFile

f.Launch

quit
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] dynapdf command for bookmarks
Date: 17.01.11 17:44 (Mon, 17 Jan 2011 17:44:54 +0100)
From: Christian Schmitz

Am 14.01.2011 um 23:14 schrieb Christian Schmitz:

>
>> it appears that the dynapdf bm command
>> -- for adding a bookmark -- isn't working...
>
> Will be fixed in one of the next updates to DynaPDF.

It is fixed for the final 11.0 plugins. I'll upload them later tonight or early tomorrow.

Greetings
Christian

Re: [MBS] dynapdf command for bookmarks
Date: 14.01.11 23:14 (Fri, 14 Jan 2011 23:14:02 +0100)
From: Christian Schmitz

> it appears that the dynapdf bm command
> -- for adding a bookmark -- isn't working...

Will be fixed in one of the next updates to DynaPDF.

> i'm using this in the context of "writeftext".
> is there a way to know, on a pagebreak,
> exactly what text was written on that page?

Sorry, no. This is not so easy.

What do you want to do? Maybe we can get this done with a different way?

Greetings
Christian

Re: [MBS] dynapdf command for bookmarks
Date: 14.01.11 20:50 (Fri, 14 Jan 2011 20:50:32 +0100)
From: Christian Schmitz

Am 14.01.2011 um 20:41 schrieb <email address removed>:

> christian-
>
> it appears that the dynapdf bm command
> -- for adding a bookmark -- isn't working...

I'll check with Jens for your issues.

Greetings
Christian