PurePDF Version 2.0
Re: PurePDF Version 2.0
Please upload those images somewhere so that i can test whats going wrong.
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: PurePDF Version 2.0
I think I don't need to upload image, I have use the pdf_GetErrorMessage() to see what is going on.ABBKlaus wrote:Please upload those images somewhere so that i can test whats going wrong.
And my first png logo use alpha channel. I have try to save my logo as jpeg image using "The Gimp" V2.8 and apparently if I use the "Progressive" option :Debugger wrote:Alpha channel PNG not supported.
Apparently the Progressive image load for the web generate a bug. I hope this will help you to figure out this bug.Debugger wrote:Not a JPEG file.
Regards
StarBootics
The Stone Age did not end due to a shortage of stones !
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
see also Pages 18/19 of this post - there are a number of things to be aware of concerning image size and dpi.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePDF Version 2.0
ok progressive works now. please redownload the latest Version from my site 

Code: Select all
Procedure ipdf_ParseJPG(*aData.MEM_DataStructure)
Protected vStart,vLength,vFound,vResult,vByte.b
;Block Length
vLength = ((PeekB(*aData\pData + 4) & $FF)*$100) + (PeekB(*aData\pData + 5) & $FF)
vStart = 4 + vLength
vFound = #False
While (vFound <> #True) And (vStart + 9 < *aData\lCurSize)
vByte=PeekB(*aData\pData + vStart) & $FF
If vByte = -1
vByte = PeekB(*aData\pData + vStart + 1) & $FF
If (vByte = -64) Or (vByte = -62)
vFound = #True
Images()\Bpc = PeekB(*aData\pData + vStart + 4)
Images()\Height = ((PeekB(*aData\pData + vStart + 5) & $FF)*$100) + (PeekB(*aData\pData + vStart + 6) & $FF)
Images()\Width = ((PeekB(*aData\pData + vStart + 7) & $FF)*$100) + (PeekB(*aData\pData + vStart + 8) & $FF)
; Gray = 1/Color = 3
Select PeekB(*aData\pData + vStart + 9) & $FF
Case 1
Images()\ColSpace = "DeviceGray"
Case 3
Images()\ColSpace = "DeviceRGB"
Default:
Images()\ColSpace = "DeviceCMYK"
EndSelect
Images()\DataPic\pData = *aData\pData
Images()\DataPic\lCurSize = *aData\lCurSize
vResult = #True
Else
;Block Length
vLength = ((PeekB(*aData\pData + vStart + 2) & $FF)*$100) + (PeekB(*aData\pData + vStart + 3) & $FF)
vStart = vStart + vLength + 2
EndIf
Else
pdfError = #PDF_ERROR_JPEG_FILE_IS_NOT_SUPPORTED
vResult = #False
Break
EndIf
Wend
ProcedureReturn vResult
EndProcedure
Re: PurePDF Version 2.0
Hi!
Did I miss something or is it not possible to
include an image without saving it first to
HD an then reload this image?
pdf_Image() needs a path to an image. so
I can't use a drawing wich I want to include
in a pdf file.
A pdf_Image(#Img, ...) would be a nice feature.
Did I miss something or is it not possible to
include an image without saving it first to
HD an then reload this image?
pdf_Image() needs a path to an image. so
I can't use a drawing wich I want to include
in a pdf file.
A pdf_Image(#Img, ...) would be a nice feature.

Re: PurePDF Version 2.0
Did you try pdf_ImageMem() ?
Its not possible with PureBasic commands to create a JPG or PNG in Memory. Maybe there´s an api way ?
[/Edit]Found it : *Buffer = EncodeImage(#Image [, ImagePlugin [, Flags [, Depth]]])[Edit]
Its not possible with PureBasic commands to create a JPG or PNG in Memory. Maybe there´s an api way ?
[/Edit]Found it : *Buffer = EncodeImage(#Image [, ImagePlugin [, Flags [, Depth]]])[Edit]
-
- User
- Posts: 18
- Joined: Tue Oct 01, 2013 12:57 pm
Re: PurePDF Version 2.0
I give an example of "encodeImage" in another of my posts: http://www.purebasic.fr/english/viewtop ... 13&t=56927, with the help of Chris 

Last edited by Loopingstar on Wed Oct 09, 2013 8:23 am, edited 1 time in total.
Re: PurePDF Version 2.0
Yup, that's the way to go.ABBKlaus wrote:...
[/Edit]Found it : *Buffer = EncodeImage(#Image [, ImagePlugin [, Flags [, Depth]]])[Edit]
I didn't know, that the path string in pdf_ImageMem() isn't relevant.
Thanks for this hint (and PurePDF anyway

Thank you for this additional example.Loopingstar wrote:I give an example of "encodeImage" in another of my posts: http://www.purebasic.fr/english/viewtop ... 13&t=56927

Re: PurePDF Version 2.0
Unicode for Japanese.
I am trying to use Japanese chars with PurePDF, I have followed the Tutorial regarding unicode and when printing a char like Chr(12452), with the font "Lucida Sans Unicode", compiler set to "Create Unicode Executable" I get a Square.
In order to check the problem if you use "XIncludeFile "Source\PurePDF.pb" then in the Debug window we see this error: "Font contains a broken glyph code mapping, ignored" ... someone has found the same trouble?
Thanks
I am trying to use Japanese chars with PurePDF, I have followed the Tutorial regarding unicode and when printing a char like Chr(12452), with the font "Lucida Sans Unicode", compiler set to "Create Unicode Executable" I get a Square.
In order to check the problem if you use "XIncludeFile "Source\PurePDF.pb" then in the Debug window we see this error: "Font contains a broken glyph code mapping, ignored" ... someone has found the same trouble?
Thanks
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
First thing to do then is try another font.........
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePDF Version 2.0
There is no char in that font with $30A4 (12452)
What char do you want ?

What char do you want ?
Re: PurePDF Version 2.0
Hi all,
i fixed two issue´s with unicode fonts. Please redownload the latest version from my website.
i fixed two issue´s with unicode fonts. Please redownload the latest version from my website.
- ipdf_Handle_MS_Encoding() changed variable n.w to n.u
- ipdf_Handle_MS_Encoding() fixed broken glyph code detection
Re: PurePDF Version 2.0
Hi!
What went wrong here:I'm getting a "Not a JPEG file."-Error for Quality settings 0 to 2.
SaveImage() doesn't complain for Quality=0 to Quality=2.
What went wrong here:
Code: Select all
#PurePDF_Include=1
;Put you path pointing to "PurePDF.pb" and "PurePDF.res" here:
IncludePath "....\PurePDF\Examples\PurePDF\"
;
XIncludeFile "PurePDF_res.pb"
XIncludeFile "PurePDF.pb"
Define Logo.s, myPath.s, Error.s
Define ImgW,i, ImgH.i
Define Quality.i
Define *myImgBuffer
UsePNGImageDecoder()
UseJPEGImageEncoder()
Logo.s=#PB_Compiler_Home+"Examples\3D\Data\PureBasic3DLogo.png"
;Put your path for PDF and JPG files here
myPath.s="...."
;
If LoadImage(1, Logo)
ImgW=ImageWidth(1)
ImgH=ImageHeight(1)
For Quality= 0 To 10
Debug "Loop start ---"
*myImgBuffer=EncodeImage(1, #PB_ImagePlugin_JPEG, Quality)
If *myImgBuffer
Debug "Quality: "+Str(Quality)
pdf_Create("P", "pt", Str(ImgW)+","+Str(ImgH))
pdf_setmargins(0,0,0)
pdf_AddPage()
pdf_ImageMem("", *myImgBuffer, MemorySize(*myImgBuffer), 0, 0)
Debug pdf_geterrormessage()
pdf_Save(myPath+"\PDFTestQ"+Str(Quality)+".pdf")
Debug pdf_geterrormessage()
; save JPG for reference purpose
SaveImage(1 , myPath+"\JPGTestQ"+Str(Quality)+".jpg", #PB_ImagePlugin_JPEG, Quality)
;
FreeMemory(*myImgBuffer)
EndIf
Debug "Loop end ----"
Next Quality
EndIf
SaveImage() doesn't complain for Quality=0 to Quality=2.

Re: PurePDF Version 2.0
Hi Lord,
Thanks for beta testing
The Extended sequential DCT was missing.
I uploaded a bugfixed version here : http://www.purebasicpower.de/?download= ... B52X86.zip
Thanks for beta testing

The Extended sequential DCT was missing.
I uploaded a bugfixed version here : http://www.purebasicpower.de/?download= ... B52X86.zip
Re: PurePDF Version 2.0
Hi ABBKlauss,
Is it possible to print an html file in pDF with PurePDF ? If no does-it exists something to do that except with Microsoft Office or Open Offce
Thanks in advance
Is it possible to print an html file in pDF with PurePDF ? If no does-it exists something to do that except with Microsoft Office or Open Offce
Thanks in advance