Page 30 of 32

Re: PurePDF Version 2.0

Posted: Sat Sep 24, 2016 3:58 pm
by normeus
[EDIT 9/25/2016]
so the easiest way around it is to change the replacement string to a single character or better yet, an unused control code like Chr(16)

Code: Select all

;Unicode example
;===============
#PurePDF_Include=1

xIncludeFile "\purepdf\Examples\PurePDF.pb" ; <-------- REPLACE THIS FILES LOCATION


CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    #ZLIB_IMPORT_PATH = #PB_Compiler_Home + "purelibraries/linux/libraries/zlib.a"
  CompilerCase #PB_OS_Windows
    #ZLIB_IMPORT_PATH = "zlib.lib"
  CompilerCase #PB_OS_MacOS
    #ZLIB_IMPORT_PATH = "/usr/lib/libz.dylib"
CompilerEndSelect

ImportC #ZLIB_IMPORT_PATH
  compress.l(*dest, *destlen, *source, sourcelen)
EndImport

Procedure.l PDFCompress(*aData.MEM_DataStructure)
  Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
  
  lbError = #False
  SourceLen = *aData\lCurSize
  SourceMem = *aData\pData 
  CompLen   = (Int(SourceLen/8000)+1)*8000 + 16 
  CompMem=AllocateMemory(CompLen)
  If CompMem
    zerr=compress(CompMem,@CompLen,SourceMem,SourceLen)
    If zerr = 0
      *aData\pData = CompMem
      *aData\lMaxSize = CompLen
      *aData\lCurSize = CompLen
      ;FreeMemory(Sourcemem) ; <- Crash with enabled purifier if run as TailBiten library
      lbError = #True 
    EndIf
  EndIf
  ProcedureReturn lbError  
EndProcedure

Procedure Footer()
  pdf_SetY(-15);
  pdf_SetFont("Arial","I",8);
  pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"/"+Chr(16),0,0,#PDF_ALIGN_CENTER);
EndProcedure


Define File$
Define String$,StringWidth.d,i

File$=GetFilePart(#PB_Compiler_File)
File$=Mid(File$,1,Len(File$)-Len(GetExtensionPart(File$))-1)

pdf_Create()
pdf_SetProcFooter(@Footer())
pdf_AliasNbPages(Chr(16)); you need this to match your Footer procedure currently chr(16)
pdf_SetAuthor("PurePDF")
pdf_SetTitle(File$)
pdf_SetSubject("Unicode Text")
pdf_SetCreator("PurePDF")
pdf_SetKeywords(StringField(File$,1," "))
pdf_SetProcCompression(@PDFCompress())
pdf_AddPage()
pdf_SetFont("Lucida Sans Unicode","",28)
pdf_Text(20,30,"PUЯЭPƉƑ ǐs ҪʘʘΊ")
pdf_BookMark("Page 1a")
pdf_Text(20,50,"☺☻☼♀♂♠♣♥♦♪♫")
pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
pdf_AddPage()
pdf_SetFont("Lucida Sans Unicode","",28)
pdf_Text(20,30,"PUЯЭPƉƑ ǐs ҪʘʘΊ")
pdf_Text(20,50,"☺☻☼♀♂♠♣♥♦♪♫")
pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))

pdf_Save(File$+".pdf")
RunProgram(File$+".pdf")
This works on 5.42 LTS X64 unicode.

Norm.

Re: PurePDF Version 2.0

Posted: Mon Sep 26, 2016 7:26 am
by Lord
normeus wrote:[EDIT 9/25/2016]
so the easiest way around it is to change the replacement string to a single character or better yet, an unused control code like Chr(16)
...
This works on 5.42 LTS X64 unicode.

Norm.
This workaround works with PBv5.50(x86) too.

Again, thank you very much for your help!

Lord

Re: PurePDF Version 2.0

Posted: Mon Sep 26, 2016 4:25 pm
by Lord
Oh oh...

The workaround does only work with one digit (1 ... 9).
Starting with 10 you get an digit and a square (1[]).

Re: PurePDF Version 2.0

Posted: Sat Oct 08, 2016 10:31 am
by Lord
Hello!

Any news on this topic?
Is there a cure in sight?

Missing pages

Posted: Mon Oct 10, 2016 5:04 pm
by Lord
Hello!

I stumbled over something weird.

Taking the code from here: http://www.purebasic.fr/english/viewtop ... &start=438
and let it produce some more pages

Code: Select all

;Unicode example
;===============
#PurePDF_Include=1

xIncludeFile "\purepdf\Examples\PurePDF.pb" ; <-------- REPLACE THIS FILES LOCATION

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    #ZLIB_IMPORT_PATH = #PB_Compiler_Home + "purelibraries/linux/libraries/zlib.a"
  CompilerCase #PB_OS_Windows
    #ZLIB_IMPORT_PATH = "zlib.lib"
  CompilerCase #PB_OS_MacOS
    #ZLIB_IMPORT_PATH = "/usr/lib/libz.dylib"
CompilerEndSelect

ImportC #ZLIB_IMPORT_PATH
  compress.l(*dest, *destlen, *source, sourcelen)
EndImport

Procedure.l PDFCompress(*aData.MEM_DataStructure)
  Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
 
  lbError = #False
  SourceLen = *aData\lCurSize
  SourceMem = *aData\pData
  CompLen   = (Int(SourceLen/8000)+1)*8000 + 16
  CompMem=AllocateMemory(CompLen)
  If CompMem
    zerr=compress(CompMem,@CompLen,SourceMem,SourceLen)
    If zerr = 0
      *aData\pData = CompMem
      *aData\lMaxSize = CompLen
      *aData\lCurSize = CompLen
      ;FreeMemory(Sourcemem) ; <- Crash with enabled purifier if run as TailBiten library
      lbError = #True
    EndIf
  EndIf
  ProcedureReturn lbError 
EndProcedure

Procedure Footer()
  pdf_SetY(-15);
  pdf_SetFont("Arial","I",8);
  pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"/"+Chr(16),0,0,#PDF_ALIGN_CENTER);
EndProcedure


Define File$
Define String$,StringWidth.d,i

File$=GetFilePart(#PB_Compiler_File)
File$=Mid(File$,1,Len(File$)-Len(GetExtensionPart(File$))-1)

pdf_Create()
pdf_SetProcFooter(@Footer())
pdf_AliasNbPages(Chr(16)); you need this to match your Footer procedure currently chr(16)
pdf_SetAuthor("PurePDF")
pdf_SetTitle(File$)
pdf_SetSubject("Unicode Text")
pdf_SetCreator("PurePDF")
pdf_SetKeywords(StringField(File$,1," "))
; pdf_SetProcCompression(@PDFCompress())
pdf_AddPage()
pdf_SetFont("Lucida Sans Unicode","",28)
pdf_Text(20,30,"PU??PЃ is ????")
pdf_BookMark("Page 1a")
pdf_Text(20,50,"??¤????????")
pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
pdf_SetFont("Lucida Sans Unicode","",28)

For i=1 To 15
  pdf_AddPage()
  pdf_Text(20,30,"PU??PЃ is ????")
  pdf_Text(20,50,"??¤????????")
  pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
  pdf_text(20, 90, "Counter i="+Str(i))
Next

pdf_Save(File$+".pdf")
RunProgram(File$+".pdf")
As a result all even pages after page 3 are missing.

What's going on here?

Re: PurePDF Version 2.0

Posted: Tue Oct 11, 2016 1:23 am
by normeus
Sorry, I've haven't checked this thread until today.

There is a fix if you take a look at the original code:
http://www.purebasic.fr/english/viewtop ... 44#p463744

1. use Chr(14) instead of 16 ( sixteen was giving you the odd pages )
2. download the new updated Hack.
3. Disco or at least test and let me know how it works for you



Norm.

Re: PurePDF Version 2.0

Posted: Tue Oct 11, 2016 11:02 am
by Lord
Hi Norm.!

First off all: It works, but...

If I take your "new" procedure MEM_DataReplace() it gives me an
"[ERROR] Overflow in a dynamically allocated memeora block"
on this line:

Code: Select all

  *vaDest=AllocateMemory(vDestLen)     ; HACK - needed to change number to ASCII
So I added "+2" to vDestLen in this procedure (as it was previous).
I don't know, maybe "vLen" or SizeOfCharacter() should be added here?

After this and after replacing "16" with "14" the footer works. Also no
more blank pages.

Another remark: If I use "Arial", there is always a space between
the two digits, when the page number is going over 9. "Tahoma"
and "MS Sans Serif" are working fine.

So, for me, PurePDF works again.
Thank you for your help.

offer

Re: PurePDF Version 2.0

Posted: Wed Oct 12, 2016 1:29 am
by normeus
[EDIT Oct-15-2016]
:oops: Now it works, had a fence post problem with comparing memory so changed the comparison to CompareMemory instead of loops anyway this one should finally work and be faster.
[EDIT Oct-12-2016]
My compiler was letting me get away with defining a memory space that was too small. I wonder if it is because my CPU is a XEON ( just blindly throwing darts ).
Thank you @Lord for helping me with this. I installed the same 5.42 LTS version on another computer and I see the memory error @Lord saw.
Anyway this code should work now.


This code should work with Unicode and ASCII for footer and it has the functionality of using "{nb}" or anything as a place holder for pages.
There is one extra step. In order for this procedure to work it has to be moved from its current location before

Code: Select all

pdf_Init()
to after

Code: Select all

pdf_Init()
this is not as bad as it sounds since both procedures are next to each other. This has to be done because

Code: Select all

Global Fonts()
has to be declared so we can use it to test for ASCII font.

This works on Windows 7 64x with PB 5.42 LTS (x64)
here is the code, remember to move this procedure after pdf_init():

Code: Select all

Procedure MEM_DataReplace(*aData.MEM_DataStructure, aSource.s, aDest.s) ; MOVE THIS PROCEDURE TO BE AFTER pdf_Init()
  Protected vSourceLen,vDestLen,vCurSize,vMaxSize,vCount,vFind,*tmp,vReturn,i,j,*vaSource
  Protected vLen,*vaDest,vaDestString,fontU ; Needed for Unicode to ASCII
 ;MEM_DataStructure is ASCII so we have play a bit with footer fonts() is declared in pdf_Init(), plan accordingly
  
  fontU= fonts()\unicode      ; find out if Unicode or ASCII FONT
  vLen = SizeOf(Character)    ; find out if Unicode or ASCII program  
  vSourceLen   = StringByteLength(aSource); changed to StringByteLength for Unicode
  *vaSource    = AllocateMemory(vSourceLen); created a temp buffer for Unicode
  If fontU=0                                
    PokeS(*vaSource,aSource,vSourceLen,#PB_String_NoZero|#PB_Ascii); font is ASCII 
  Else
    PokeS(*vaSource,aSource,vSourceLen,#PB_String_NoZero);saved Unicode string to mem to compare mem not string ;  
  vSourceLen - 1  
  EndIf
  ;ShowMemoryViewer(@asource,vSourceLen)
  ; CallDebugger
  ;          ShowMemoryViewer(*vaSource,vSourceLen)
  ;      CallDebugger
  If vlen=1 Or  fontU=0                      
    vSourceLen=(vSourceLen/vlen); ASCII font or ASCII program, resize source
  EndIf  
  
  vDestLen     = StringByteLength(aDest) ; changed to StringByteLength
  If fontU=0 And vlen=2 
    vDestLen=(vDestLen/vlen)+1 ;ASCII font Unicode program
  EndIf
  
  *vaDest=AllocateMemory(vDestLen)
  If fontU=0 
    PokeS(*vaDest,aDest,vDestLen,#PB_Ascii|#PB_String_NoZero) ; ASCII FONT
  Else
    PokeS(*vaDest,aDest,vDestLen,#PB_Unicode|#PB_String_NoZero); Unicode
  EndIf

  vCurSize     = *aData\lCursize  
  vMaxSize     = *aData\lMaxsize  
  vFind        = 0
  vReturn      = #True
  
  If (vDestLen > vSourceLen)
    For i = vCurSize To 0 Step -1
      vCount= 0
      If CompareMemory(*aData\pData + i - vSourceLen,*vaSource,vSourceLen)  
        vFind = vFind + 1  
        Break
      EndIf
    Next
    If (vFind > 0)
      vReturn = MEM_DataInit(*aData, vMaxSize + (vFind*(vDestLen - vSourceLen))) ; = #False
    EndIf  
  EndIf
  
  If vReturn = #True
    *tmp = AllocateMemory((vDestLen + vCurSize) - vSourceLen)
    If *tmp
      For i = vCurSize To 0 Step -1
        If CompareMemory(*aData\pData + i - vSourceLen,*vaSource,vSourceLen)
          CopyMemory(*aData\pData + i, *tmp, *aData\lCurSize - i)
          CopyMemory(*vaDest, *aData\pData + i - vSourceLen  , vDestLen ) ; 
          CopyMemory(*tmp, *aData\pData + (i-fontU) - vSourceLen + vDestLen, *aData\lCurSize - i) ; COPY according to ASCII or UNICODE font
          *aData\lCurSize = *aData\lCurSize + (vDestLen-vSourceLen)
          Break
        EndIf
      Next
      FreeMemory(*tmp)
    Else
      vReturn = #False
    EndIf
  EndIf
  FreeMemory(*vaSource) ; used to search as memory and not string
  FreeMemory(*vaDest)   ; Temp change to ASCII
  ProcedureReturn vReturn
EndProcedure
Norm.

Re: PurePDF Version 2.0

Posted: Wed Oct 12, 2016 12:23 pm
by Lord
Hi Norm.!

Thank you for your effort to solve this page numbering problem.

This version does work (for me) only in ASCII mode (PB 5.42LTS x64),
not in Unicode mode (PB 5.42LTS x64 and PB 5.50 x86).
In Unicode mode I got "{nb}" if using "{nb}" as placeholder and a
little square (as expected) when using Chr(14) as placeholder.

I think, I will stick to the previous working solution with CHR(14) as
placeholder and the previous version of MEM_DataReplace() before
pdf_Init().

Greetings

Lord

Re: PurePDF Version 2.0

Posted: Wed Oct 12, 2016 7:20 pm
by normeus
@Lord,
I installed PB 5.42LTS x64 on a different computer and behold I see the error you are getting!!!

I guess all 5.42LTS are not created equal. The one at work never gave me an error on this command:

Code: Select all

 If fontU=0                                
    PokeS(*vaSource,aSource,vSourceLen,#PB_Ascii); font is ASCII 
  Else
    PokeS(*vaSource,aSource,vSourceLen);saved Unicode string to mem to compare mem not string ;  
  EndIf
but in the Docs ( who needs stinking Docs anyway) PokeS adds a terminating zero to end.
This is the right code:

Code: Select all

 If fontU=0                                
    PokeS(*vaSource,aSource,vSourceLen,#PB_String_NoZero|#PB_Ascii); font is ASCII 
  Else
    PokeS(*vaSource,aSource,vSourceLen,#PB_String_NoZero);saved Unicode string to mem to compare mem not string ;  
  EndIf
I changed it on my revised hack which by the way I am not calling a hack anymore
because it should work all the time and with fancy footwork. like ( note text after replacement number)

Code: Select all

 pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"of {nb} Total",0,0,#PDF_ALIGN_CENTER);
Norm.

Re: PurePDF Version 2.0

Posted: Thu Oct 13, 2016 11:57 am
by Lord
Hi Norm.!

I tried your (not anymore called hack) changes again.
It works, but only if I use "Arial".
When I switch to, for example, "MS Sans Serif" or "Tahoma"
I still get a "{nb}".
Changing from "{nb}" to Chr(14) gives again a small square.
Sorry for that.
Text after the Chr(14) replacement always worked for me.

This is a slightly modified test code to show the faulty result:

Code: Select all

;Unicode example
;===============
#PurePDF_Include=1

XIncludeFile "\purepdf\Examples\PurePDF.pb" ; <-------- REPLACE THIS FILES LOCATION

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    #ZLIB_IMPORT_PATH = #PB_Compiler_Home + "purelibraries/linux/libraries/zlib.a"
  CompilerCase #PB_OS_Windows
    #ZLIB_IMPORT_PATH = "zlib.lib"
  CompilerCase #PB_OS_MacOS
    #ZLIB_IMPORT_PATH = "/usr/lib/libz.dylib"
CompilerEndSelect

ImportC #ZLIB_IMPORT_PATH
  compress.l(*dest, *destlen, *source, sourcelen)
EndImport

Procedure.l PDFCompress(*aData.MEM_DataStructure)
  Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
 
  lbError = #False
  SourceLen = *aData\lCurSize
  SourceMem = *aData\pData
  CompLen   = (Int(SourceLen/8000)+1)*8000 + 16
  CompMem=AllocateMemory(CompLen)
  If CompMem
    zerr=compress(CompMem,@CompLen,SourceMem,SourceLen)
    If zerr = 0
      *aData\pData = CompMem
      *aData\lMaxSize = CompLen
      *aData\lCurSize = CompLen
      ;FreeMemory(Sourcemem) ; <- Crash with enabled purifier if run as TailBiten library
      lbError = #True
    EndIf
  EndIf
  ProcedureReturn lbError
EndProcedure

Procedure Footer()
  pdf_SetY(-15);
  pdf_SetFont("MS Sans Serif","I",8);
;   pdf_SetFont("Tahoma","I",8);
;   pdf_SetFont("Arial","I",8);
;   pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"/"+Chr(14),0,0,#PDF_ALIGN_center);
  pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"/"+"{nb}",0,0,#PDF_ALIGN_center);
EndProcedure


Define File$
Define String$,StringWidth.d,i

File$=GetFilePart(#PB_Compiler_File)
File$=Mid(File$,1,Len(File$)-Len(GetExtensionPart(File$))-1)

pdf_Create()
pdf_SetProcFooter(@Footer())
; pdf_AliasNbPages(Chr(14)); you need this to match your Footer procedure currently chr(16)
pdf_AliasNbPages("{nb}")
pdf_SetAuthor("PurePDF")
pdf_SetTitle(File$)
pdf_SetSubject("Unicode Text")
pdf_SetCreator("PurePDF")
pdf_SetKeywords(StringField(File$,1," "))
pdf_SetProcCompression(@PDFCompress())
pdf_AddPage()
pdf_SetFont("Lucida Sans Unicode","",28)
pdf_Text(20,30,"PU??PЃ is ????")
pdf_BookMark("Page 1a")
pdf_Text(20,50,"??¤????????")
pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
pdf_SetFont("Lucida Sans Unicode","",28)

For i=1 To 15
  pdf_AddPage()
  pdf_Text(20,30,"PU??PЃ is ????")
  pdf_Text(20,50,"??¤????????")
  pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
  pdf_text(20, 90, "Counter i="+Str(i))
Next

pdf_Save(File$+".pdf")
RunProgram(File$+".pdf")
Again, I will stick for now to the previous working solution with
the old procedure and Chr(14).

But still a great THANK YOU for helping.

Lord

Re: PurePDF Version 2.0

Posted: Sat Oct 15, 2016 5:30 pm
by Lord
Hi!

May be a silly question, but what is the right way to clean
up after interrupting the creation of a pdf (no PDF2File()
executed)?
When I start a new pdf, I got the lines that were created
before the interruption in front of the newly created lines.

Is there someting like a pdf_CleanUp()?

Re: PurePDF Version 2.0

Posted: Sat Oct 15, 2016 9:27 pm
by normeus
This is what happens after you save so this will clear the PDF buffer and footer.
The title and other global variables
will still be there ( stuff that you set like pdf_SetAuthor(),pdf_SetTitle(),ETC... )

Code: Select all

ipdf_Close()
  If pdfBuffer\pData
    FreeMemory(pdfBuffer\pData)
  EndIf
  pdfBuffer\pData=0

Norm.

Re: PurePDF Version 2.0

Posted: Sun Oct 16, 2016 11:43 am
by Lord
Hi Norm.!

Thanks Norm.! Your snipped works.

But now I stumbled over the next hurdle.
It has to do with bookmarks.
When I create a PDf document twice, the first copy
will have bookmarks, the second has none. Everything
else looks ok.

It makes no difference wether
- I create the first document save this and creating
the second and save that
or
- interrupting the creation of the first document and
create this document again and save it.

Always the bookmarks are missing on second run.

When debugging, I can see that pdf_BookMark(msg)
is always called and msg has always the correct text.

What can be the reason for this?

Here is the example showing this result. I took the last
test code and put the pdf-creation in an procedure
and call this procedure twice:

Code: Select all

;Unicode example
;===============
#PurePDF_Include=1

XIncludeFile "\purepdf\Examples\PurePDF.pb" ; <-------- REPLACE THIS FILES LOCATION


CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    #ZLIB_IMPORT_PATH = #PB_Compiler_Home + "purelibraries/linux/libraries/zlib.a"
  CompilerCase #PB_OS_Windows
    #ZLIB_IMPORT_PATH = "zlib.lib"
  CompilerCase #PB_OS_MacOS
    #ZLIB_IMPORT_PATH = "/usr/lib/libz.dylib"
CompilerEndSelect

ImportC #ZLIB_IMPORT_PATH
  compress.l(*dest, *destlen, *source, sourcelen)
EndImport

Procedure.l PDFCompress(*aData.MEM_DataStructure)
  Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
 
  lbError = #False
  SourceLen = *aData\lCurSize
  SourceMem = *aData\pData
  CompLen   = (Int(SourceLen/8000)+1)*8000 + 16
  CompMem=AllocateMemory(CompLen)
  If CompMem
    zerr=compress(CompMem,@CompLen,SourceMem,SourceLen)
    If zerr = 0
      *aData\pData = CompMem
      *aData\lMaxSize = CompLen
      *aData\lCurSize = CompLen
      ;FreeMemory(Sourcemem) ; <- Crash with enabled purifier if run as TailBiten library
      lbError = #True
    EndIf
  EndIf
  ProcedureReturn lbError
EndProcedure

Procedure Footer()
  pdf_SetY(-15);
  pdf_SetFont("MS SansSerif","I",8);
  pdf_Cell(0,10,"Page "+Str(pdf_GetPageNo())+"/"+Chr(14),0,0,#PDF_ALIGN_CENTER);
EndProcedure


Procedure makePDF(run)
Protected File$
Protected String$,StringWidth.d,i
Protected CreateBookmarks=#True

File$=GetFilePart(#PB_Compiler_File)
File$=Mid(File$,1,Len(File$)-Len(GetExtensionPart(File$))-1)

pdf_Create()
pdf_SetProcFooter(@Footer())
pdf_AliasNbPages(Chr(14)); you need this to match your Footer procedure currently chr(16)
pdf_SetAuthor("PurePDF")
pdf_SetTitle(File$)
pdf_SetSubject("Unicode Text")
pdf_SetCreator("PurePDF")
pdf_SetKeywords(StringField(File$,1," "))
; pdf_SetProcCompression(@PDFCompress())
pdf_AddPage()
pdf_SetFont("Lucida Sans Unicode","",28)
pdf_Text(20,30,"PU??PЃ is ????")
pdf_BookMark("Page 1a")
pdf_Text(20,50,"??¤????????")
pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
pdf_SetFont("Lucida Sans Unicode","",28)

For i=1 To 15
  pdf_AddPage()
   If CreateBookmarks
    pdf_BookMark("Page "+Str(i+1))
  EndIf
  pdf_Text(20,30,"PU??PЃ is ????")
  pdf_Text(20,50,"??¤????????")
  pdf_Text(20,70,Chr($107)+Chr($108)+Chr($109)+Chr($10A)+Chr($10B)+Chr($10C)+Chr($10D))
  pdf_text(20, 90, "Counter i="+Str(i))
Next

file$=Str(run)
pdf_Save(File$+".pdf")
RunProgram(File$+".pdf")
EndProcedure

makepdf(1)
makepdf(2)

Re: PurePDF Version 2.0

Posted: Sun Oct 16, 2016 2:26 pm
by normeus
That answer is on the help file:

Code: Select all

pdf_ResetBookMark()
by the way, I have made some useful changes to bookmarks all you have to do is copy the code if you go back a couple of page from this thread. Use google search which easily finds stuff in the forum:

https://www.google.com/advanced_search? ... rebasic.fr


Norm.