It is currently Sun Mar 07, 2021 10:42 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Thu Oct 22, 2020 10:59 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 356
infratec wrote:
That's very 'Basic' :mrgreen:
Code:
If OpenWindow(0, 0, 0, 400, 100, "ImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If LoadImage(0, #PB_Compiler_Home + "Examples\Sources\Data\PureBasicLogo.bmp")
   
    If CreateImage(1, 80, 50, 24, #Red)
     
      If StartDrawing(ImageOutput(0))
        DrawImage(ImageID(1), 80, 15)
        StopDrawing()
      EndIf
    EndIf
   
    ImageGadget(0,  10, 10, 0, 0, ImageID(0))
  EndIf
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Thanks infratec I will try to see if the qrcode is readable after including another image


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Tue Nov 10, 2020 8:21 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 356
Can someone help me on How to decode a qrcode with Purebasic. With zbarimg some image can be decodeand other one no
THanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Wed Nov 11, 2020 10:08 am 
Offline
Addict
Addict
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 1080
Location: Germany
Could you please provide us an image?
I have tested ZBar and Pb 5.73B3 x86 and everything seems to work..

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Fri Nov 13, 2020 7:16 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 356
Extraction de l'image faite avec PDFImages

Image

LIens
http://www.sepa-convertir.ch/utilitaires/purebasic/facture2.pdf
http://www.sepa-convertir.ch/utilitaires/purebasic/toto2.png

the PDF invoice2.pdf has been processed with PDFCAIRO and the result can be found in
Resultat dans toto.png
Phaseun
Code:
pdftocairo -png -cropbox -x 380 -y 1220 -H 300 -W 298 -gray -transp facture2.pdf

zbarimg.exe -D toto.png

Hoping that this will be enough for you


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Fri Nov 13, 2020 7:58 am 
Offline
Always Here
Always Here

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 5293
Location: Germany
I told you already that the quality of the image inside of the PDF is bad and the extracted image is even worse.

You have to put the generated code in 100% quality inside the PDF.


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Fri Nov 13, 2020 9:46 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 14, 2014 12:09 pm
Posts: 356
infratec wrote:
I told you already that the quality of the image inside of the PDF is bad and the extracted image is even worse.

You have to put the generated code in 100% quality inside the PDF.


Quote:
I know that. I tried to improve the quality of the PDF with GHOSTSCRIPT but it doesn't work. The problem I have is related to ZBARIMAGE (problem already raised in 2017 on the ZBAR forum but not solved to date)
For your information, the file facture2.pdf comes from the validation site of SIX Switzerland, which means that I don't have the hand on the creation of this PDF. I have to treat it as it is. What I don't understand is that software like PDFCandy treats the conversion of the PDF facture2 without any problem into PNG and then the PNG is treated as a QRCODE.

Have you a solution to generated code in 100% quality inside the PDF. ?
I am ready to buy a command line tools for converting PDF into QRCODE via img


Top
 Profile  
Reply with quote  
 Post subject: Re: Create QRCode (2D-Barcode)
PostPosted: Fri Nov 13, 2020 10:16 am 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 991
Quote:
... converting PDF into QRCODE via img...
The PDF format is simply an encapsulation of elements. Text is converted, but images remain in their original format (jpg, bmp, png etc). It is thus enough to extract the whole (provided that the elements are not encrypted).
Do not try to convert a whole PDF file into a single image: this is the worst way to destroy the quality of the original images, thus making QRCodes unreadable.

Extract images from PDF file: There are free tools that do it very well
One of them (freeware)
https://www.pdfarea.com/PDF-Image-Extractor.htm
(There are also probably some available on the command line.)
It does extract the QRCode given in your example. But I was only able to read it one time out of 10 with my phone (while all the other QRCodes I usually read work).

@loulou2522
You had to create another topic, because your question is about reading and not about creating a QRCode :wink:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye