
PurePDF Version 2.0
i think you haven´t installed the lib correctly.
Please read this how to (its located at the bottom) : http://www.purearea.net/pb/english/userlibs.php
These files are needed (at least the first two) to run the demo´s :
Please read this how to (its located at the bottom) : http://www.purearea.net/pb/english/userlibs.php
These files are needed (at least the first two) to run the demo´s :
Code: Select all
%PBDIR%\PureLibraries\UserLibraries\PurePDF
%PBDIR%\Residents\PurePDF_res.res
%PBDIR%\SubSystems\UserLibThreadSafe\PureLibraries\UserLibraries\PurePDF
%PBDIR%\SubSystems\UserLibUnicode\PureLibraries\UserLibraries\PurePDF
%PBDIR%\SubSystems\UserLibUnicodeThreadSafe\PureLibraries\UserLibraries\PurePDF
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
I found a bug. If the text is shorter than "..." it causes a endless loop (infinite loop).
Code: Select all
Procedure.s pdf_TruncateCell(w.f, h.f=0, Text$="", border.w=0, Ln.f=0, Align$=#PDF_ALIGN_LEFT, Fill.f=0, Link.w=0, trunc$="...")
Protected wMax.f, TLen.l, short$
If w <= 0 ; Seitenbreite
w = pdfW - pdfRMargin - pdfX
EndIf
wMax = w - (2 * pdfCMargin)
If pdf_GetStringWidth(Text$) <= wMax
pdf_Cell(w, h, Text$, border, Ln, Align$, Fill, Link)
Else
TLen = Len(Text$)
While TLen
TLen - 1
short$ = Left(Text$, TLen)+trunc$
If pdf_GetStringWidth(short$) <= wMax
Break
EndIf
Wend
If TLen < 1 : short$ = "" : EndIf
pdf_Cell(w, h, short$, border, Ln, Align$, Fill, Link)
ProcedureReturn Right(Text$, Len(Text$)-TLen)
EndIf
EndProcedure
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Is it possible to attach a file to the pdf? I need to add the source file to the pdf.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
@Thorsten1867,
i made a beta version that is capable of embedding files.
You can download it here : http://www.purebasicpower.de/downloads/ ... 4_PB43.zip
A test file is i.e. Tutorial27 Include File.pb
Regards Klaus
i made a beta version that is capable of embedding files.
You can download it here : http://www.purebasicpower.de/downloads/ ... 4_PB43.zip
A test file is i.e. Tutorial27 Include File.pb
Regards Klaus
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Great! Thanks!
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
How can I (my program) extract the files again? (without Acrobat Reader)
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
You will have to parse the pdf and search for file objects.Thorsten1867 wrote:How can I (my program) extract the files again? (without Acrobat Reader)
Code: Select all
6 0 obj
<</F(20k_c1.txt)/EF<</F 7 0 R>>/Desc ()/Type/Filespec>>
endobj
Code: Select all
7 0 obj
<</Type/EmbeddedFile/Params<<
/Size 5512
/CreationDate (D:20081003014113Z)
/ModDate (D:20051017181816Z)
>>
/Length 6892
/Filter/ASCII85Decode
>>
stream
...
endstream
endobj
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Thanks a lot! I will try it.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
It seems I need something like "ipf_ASCII85_Decode()". I can create the files, but they are not readable.
Code: Select all
If ReadFile(0, "D:\Temp\Tutorial27 Include File.pdf")
While Eof(0) = 0
row$ = ReadString(0)
If Left(row$,5) = "<</F("
FileName.s = Mid(row$, 6, FindString(row$, ")", 6) - 6)
Repeat : Until ReadString(0) = "<</Type/EmbeddedFile/Params<<"
Size = Val(StringField(ReadString(0),2," "))
Repeat : Until ReadString(0) = "stream"
*Buffer = AllocateMemory(Size+1)
If *Buffer
Bytes = ReadData(0, *Buffer, Size)
If CreateFile(1, "D:\Temp\"+FileName)
WriteData(1, *Buffer, Bytes)
CloseFile(1)
EndIf
EndIf
EndIf
Wend
CloseFile(0)
EndIf
Last edited by Thorsten1867 on Wed Oct 22, 2008 6:33 pm, edited 2 times in total.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]