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.
Code: Select all
ipdf_Close()
If pdfBuffer\pData
FreeMemory(pdfBuffer\pData)
EndIf
pdfBuffer\pData=0
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)
Code: Select all
pdf_ResetBookMark()
Stupid me. I could have found it by myself.normeus wrote:That answer is on the help file:
...Code: Select all
pdf_ResetBookMark()
Code: Select all
saveX = pdfX
If (first=#True And indent > 0)
ipdf_SetX(pdfX + indent)
first = #False
EndIf
ipdf_Cell(w,h,Mid(s,j,i-j),b,2,align$,fill)
If j = 0: i + 1:EndIf ;>> If the first word is too long start on next character
Else
If(align$="J")
Code: Select all
If j = 0: i + 1:EndIf ;
Code: Select all
Select pdfZoomMode
Case #PDF_ZOOM_FULLPAGE
ipdf_Out("/OpenAction [3 0 R /Fit]")
Case #PDF_ZOOM_FULLWIDTH
ipdf_Out("/OpenAction [3 0 R /FitH null]")
Case #PDF_ZOOM_REAL
ipdf_Out("/OpenAction [3 0 R /XYZ null null 1]")
Case #PDF_ZOOM_FULLSCREEN ; <-- luis
ipdf_Out("/PageMode/FullScreen") ; <-- luis
Default:
ipdf_Out("/OpenAction [3 0 R /XYZ null null " + ipdf_StrF(pdfZoomMode/100,2) + "]")
EndSelect
Code: Select all
[846] If version = $10000 Or version = $4F54544F ; 0x00010000 for version 1.0 / can be 'true' or 'typ1' on Apple Systems
Code: Select all
Procedure.i ipdf_TTF_SearchTagName(*TTF_Memory.TTF_Header,TagName.s)
Protected version,numTables,searchRange,entrySelector,rangeShift
Protected *OffsetTable.TTF_Header_Table
Protected tag.s,checkSum.l,offset.l,Tlength.l
If *TTF_Memory
version = ipdf_EndianL(*TTF_Memory\sfnt_version)
numTables = ipdf_EndianW(*TTF_Memory\numTables)
searchRange = ipdf_EndianW(*TTF_Memory\searchRange)
entrySelector = ipdf_EndianW(*TTF_Memory\entrySelector)
rangeShift = ipdf_EndianW(*TTF_Memory\rangeShift)
If version = $10000 Or version = $4F54544F ; 0x00010000 for version 1.0 / can be 'true' or 'typ1' on Apple Systems
Code: Select all
Procedure.l pdf_AcceptPageBreak() ;Accept automatic page break or not
ProcedureReturn ipdf_AcceptPageBreak()
EndProcedure