Git Product home page Git Product logo

swissqrbill's People

Contributors

acrea1 avatar albertogoffi avatar andlinger avatar jfobranco avatar manuelbl avatar robinmamie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swissqrbill's Issues

post add separators&scissors on saved PDF without separators

🚀 Feature request

Description

iso20022 specs:
If printable qrinvoice: PDF need to be without separator
If electronic/mailed qrinvoice: PDF need to be with separatortype border+scissors

As a web app developer when an app generate a qrinvoice we always want it to be printable PDF (without separator) and we archive/save this PDF and never regenerate it.
But if later a destinator ask for a copy/reminder maybe we aim to sent it by email and we want separators&scissors on this saved pdf.
We achieved this by sugest two options on download button

  1. download original pdf (so without separators)
  2. download original pdf + edit this pdf to add border&scissors

Solution I'd like

Have a clean way with this lib to post-add separator canvas only on a pdf page, same option we currently have to generate complete qrinvoice, idea:

try (PDFCanvas canvas = new PDFCanvas(invoiceQRBillWithoutScissors, PDFCanvas.LAST_PAGE)) {
            QRBill.drawSeparators(SeparatorType.DOTTED_LINE_WITH_SCISSORS, canvas);
            Path path = Paths.get("invoice-1.pdf");
            canvas.saveAs(path);
            System.out.println("Invoice 1 saved at " + path.toAbsolutePath());
        }

What you think ?

Activate png generation

I read in the documentation that png is not the optimum way to generate the bills, but since the code exists, why not expose it?

(I'll create a pull request for this)

QR bill invalid if amount has leading zero (like 0.30)

I tested the QR bill with Raiffeisen bank with an amount of 0.30 (30 Rappen).

Raiffeisen bank said the QR bill was invalid, because the amount contained "0.30" instead of ".30" as it's supposed to be according to them. So they actually rejected the QR bill.

And here is the text from paymentstandards.ch:
"The amount element is to be entered without leading zeroes, including decimal separators and two decimal places."
(ig-qr-bill-en.pdf Page 27)

Since we set a BigDecimal number for the amount, I think the SwissQRBill library should handle this.

unresolved dependency: io.nayuki#qrcodegen;1.6: not found

Hi,

I cannot install the library in my project from maven. Here is the stack trace:

[info] Resolving io.nayuki#qrcodegen;1.6 ...
[warn]  module not found: io.nayuki#qrcodegen;1.6
[warn] ==== local: tried
[warn]   /home/cyril/.ivy2/local/io.nayuki/qrcodegen/1.6/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/io/nayuki/qrcodegen/1.6/qrcodegen-1.6.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /home/cyril/.sbt/preloaded/io.nayuki/qrcodegen/1.6/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////home/cyril/.sbt/preloaded/io/nayuki/qrcodegen/1.6/qrcodegen-1.6.pom
[info] Resolving org.apache.pdfbox#pdfbox;2.0 ...
[warn]  module not found: org.apache.pdfbox#pdfbox;2.0
[warn] ==== local: tried
[warn]   /home/cyril/.ivy2/local/org.apache.pdfbox/pdfbox/2.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/apache/pdfbox/pdfbox/2.0/pdfbox-2.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /home/cyril/.sbt/preloaded/org.apache.pdfbox/pdfbox/2.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////home/cyril/.sbt/preloaded/org/apache/pdfbox/pdfbox/2.0/pdfbox-2.0.pom
[info] Resolving jline#jline;2.14.3 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: io.nayuki#qrcodegen;1.6: not found
[warn]  :: org.apache.pdfbox#pdfbox;2.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]          io.nayuki:qrcodegen:1.6
[warn]            +- net.codecrete.qrbill:qrbill-generator:2.5.0 (/home/cyril/build.sbt#L60-82)
[warn]            +- vestaweb:vestaweb_2.11:1.0-SNAPSHOT
[warn]          org.apache.pdfbox:pdfbox:2.0
[warn]            +- net.codecrete.qrbill:qrbill-generator:2.5.0 (/home/cyril/build.sbt#L60-82)
[warn]            +- vestaweb:vestaweb_2.11:1.0-SNAPSHOT
sbt.ResolveException: unresolved dependency: io.nayuki#qrcodegen;1.6: not found
unresolved dependency: org.apache.pdfbox#pdfbox;2.0: not found
        at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:320)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
        at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
        at xsbt.boot.Using$.withResource(Using.scala:10)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
        at xsbt.boot.Locks$.apply0(Locks.scala:31)
        at xsbt.boot.Locks$.apply(Locks.scala:28)
        at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
        at sbt.IvySbt.withIvy(Ivy.scala:128)
        at sbt.IvySbt.withIvy(Ivy.scala:125)
        at sbt.IvySbt$Module.withModule(Ivy.scala:156)
        at sbt.IvyActions$.updateEither(IvyActions.scala:168)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1555)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1551)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1586)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1584)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1589)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1583)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1606)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1533)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1485)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
[error] (*:update) sbt.ResolveException: unresolved dependency: io.nayuki#qrcodegen;1.6: not found
[error] unresolved dependency: org.apache.pdfbox#pdfbox;2.0: not found
[error] Total time: 11 s, completed Apr 20, 2021 11:30:18 AM

Leading zero amount less then 1

Hi

The Raiffeisen App indicates an error when i scan a qrcode with an amount less then 1.00.
Other Apps accept this amount.
The support of the Raiffeisen told me the qrcode is not correct.

Raiffeisen App shows following error:

*Das Element Amt in (QRCH/CcyAmt) auf Zeile 19 ist ungültig.
Felddefinition: Das Element Betrag ist ohne führende Nullen inklusive Dezimaltrennzeichen und 2 Nachkomastellen anzugeben. Dezimal, maximal 12 Stellen zulässig, inklusive Dezimaltrennzeichen. Als Dezimaltrennzeichen ist nur das Punktzeichen (.) zulässig.
Betrag
Betrag der Zahlung

01: SPC
02: 0200
03: 1
04: CH7506900054228610001
05: K
06: Treson AG
07: Linsebühlstrasse 66
08: 9000 St. Gallen
09:
10:
11: CH
12:
13:
14:
15:
16:
17:
18:
19: 0.50
20: CHF
21: K
22: Paritätische Berufskommission für das Bauhauptgewerbe Kanton Schaffhau
23: Winkelriedstrasse 32
24: 8203 Schaffhausen
25:
26:
27: CH
28: NON
29:
30: Rechnung Nr. TEST 1 / Kontrolle für Demo Firma AG
31: EPD
32:

UTF-8 implementation and umlaut conversion

Hello,

first let me thank you for your brilliant library that saved me a lot of time!

I just found something in you "implementation vs guidelines" where you say that details about utf-8 are missing from the official documentation.
You can take a look at this official pdf, where there are more details about utf-8 (page 24):

https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-de.pdf

It's in german, but I hope from what I see in you wiki that's no problem.

image

There it says that the QR code is in utf-8 but only uses Latin Character Set, I interpreted that as the first 128 characters of UTF-8 and those are identical with ANSI.

Is my conclusion correct that I need to provide the data without special characters and umlauts? Or are there conversion methods in your library that I cannot find in the JavaDocs?

Thanks!

Oracle database 12c - Generate PDF

Hello,

we loaded the jar on Oracle DB12c and create our class to generate the qrbill.
If we generate with GraphicsFormat.PNG the QR is generated without problem.
When we try to generate a GraphicsFormat.PDF we get the following error:
Exception in thread "Root Thread" java.lang.NoClassDefFoundError at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1404) at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:402) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:599) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBodyCompressed(COSWriter.java:485) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1291) at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:400) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1569) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1456) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1010) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:930) at net.codecrete.qrbill.canvas.PDFCanvas.toByteArray(PDFCanvas.java:275) at net.codecrete.qrbill.generator.QRBill.generate(QRBill.java:130) at GeneraQRSwissCode2.generateQR(GeneraQRSwissCode2:104)

I looked up at all dependency and loaded the following jar
avalon-framework-4.1.5.jar log4j-1.2.17.jar logkit-1.0.1.jar javax_mail.jar bcmail-jdk15on-1.68.jar bcpkix-jdk15on-1.68.jar bcprov-jdk15on-1.68.jar commons-logging-1.2.jar fontbox-3.0.0-RC1.jar pdfbox-3.0.0-RC1.jar qrcodegen-1.6.0.jar qrbill-generator-2.5.3.jar

The oracle user we use has all java privilage.
We can convert PNG to PDF ourself but the dimension is higher then the one generate as PDF by your class and we have to generate 1000+ invoices.

The oracle DB has a 1.8_121 as JDK, maybe is that the problem .

I hope someone had the same issue.

Thank you in advance.

PDFCanvas: support byte[] in addition to File/Path, translation or rectangle, font family

Awesome library!

I couldn't figure out how to include the PDF output in a Jasper report, only SVG variant, with resulted in unselectable text (glyph rendered). So I really wanted to include the PDF output directly (so people can copy paste the IBAN, for example). Problem was that the invoice also needed to have a correctly branded page footer.

Here's the hack I used to add the QR-Rg. to the last page of my generated invoices, shifted up. Taking byte[] instead of Path/File parameter.
Maybe it will provide ideas for future API enhancements.

public class QrPdfCanvas extends PDFCanvas {
  @SuppressWarnings("unused")
  private static final Logger LOGGER = Logger.getLogger(QrPdfCanvas.class.getName());

  public QrPdfCanvas(byte[] pdfBytes) throws Exception {
    super(210, 297);

    // font not supported, hardcoded in many places in super class
    //    setupFontMetrics("Arial");
    PDDocument document = PDDocument.load(pdfBytes);
    PDPage page = document.getPage(document.getNumberOfPages() - 1);
    PDPageContentStream contentStream = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.APPEND, true, true);

    {
      Field field = PDFCanvas.class.getDeclaredField("document");
      field.setAccessible(true);
      field.set(this, document);
    }
    {
      Field field = PDFCanvas.class.getDeclaredField("contentStream");
      field.setAccessible(true);
      field.set(this, contentStream);
    }
  }

  @Override
  public void setTransformation(double translateX, double translateY, double rotate, double scaleX, double scaleY) throws IOException {
    translateX += 10;
    translateY += 50;
    super.setTransformation(translateX, translateY, rotate, scaleX, scaleY);
  }
}

ReferenceCode validation problem

It is actually not possible to use the normal ISO ReferenceCode.

When adding the Reference code to the bill, it is enlarged to 26 chars and the modulo10 is added.

bill.createAndSetQRReference(reference);

However, later on when generating the bill, the length is checked to be less than 26 chars in Payments.class:

public static boolean isValidISO11649Reference(String reference) {
reference = Strings.whiteSpaceRemoved(reference);
if (reference.length() >= 5 && reference.length() <= 25) {

Decoding

Could you please tell me whether there is a way to decode swiss qr (as image)?
I found only encoding examples in your lib

Issue with AppendToPDF

Hi Manuel,
I'm trying your great SwissQRBill project.
QRBillExample works fine. However trying AppendToPDF I get:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.pdfbox.pdmodel.PDDocument.load(Ljava/io/InputStream;)Lorg/apache/pdfbox/pdmodel/PDDocument;
at net.codecrete.qrbill.canvas.PDFCanvas.(PDFCanvas.java:83)

I develop in Eclipse environment and have your 2 jars: qrbill-generator-2.5.2.jar & qrcodegen-1.6.0.jar as well as apahe's fontbox-3.0.0-RC1.jar & pdfbox-3.0.0-RC1.jar on Java Build Path.
Am I missing something ?
Kind regards
PS:
If I'd like just to generate the QR-Code and have it displayed on the Web page, how should I do it ?

StrdBkgInf darf nicht leer sein

Ich bekomme folgenden Hinweis, wenn ich das generierte SVG auf https://validation.iso-payments.ch/gp/qrrechnung/validation validieren lasse. Wie ist das zu lösen?

GEFEG.FX Check
*******************
Check date        	: 25.01.2022
Check time        	: 12:40:54
File              	: Screenshot 2022-01-25 124035.png
File date         	: 25.01.2022
File time         	: 12:40:54
File size         	: 1.476 Bytes
Reference standard	: QR;;CH


(Line number) - Errors
******************************************************
The file contains no errors.


(Line number) - Remarks
******************************************************
(0048) - Das Element <StrdBkgInf> darf nicht leer sein, wenn dieses geliefert wird. Ausnahme: Wenn nachfolgende Elemente verwendet werden.


(0001) <?xml version="1.0" encoding="utf-8"?>
(0002) <QRCH encoding="UTF-8" eclevel="M" qrversion="12" orientation="normal">
(0003)   <Header>
(0004)     <QRType>SPC</QRType>
(0005)     <Version>0200</Version>
(0006)     <Coding>1</Coding>
(0007)   </Header>
(0008)   <CdtrInf>
(0009)     <IBAN>CH3930000004900075525</IBAN>
(0010)     <Cdtr>
(0011)       <AdrTp>S</AdrTp>
(0012)       <Name>Helvetia Schweizerische Versicherungsgesellschaft AG</Name>
(0013)       <StrtNmOrAdrLine1>Dufourstrasse</StrtNmOrAdrLine1>
(0014)       <BldgNbOrAdrLine2>40</BldgNbOrAdrLine2>
(0015)       <PstCd>9001</PstCd>
(0016)       <TwnNm>St. Gallen</TwnNm>
(0017)       <Ctry>CH</Ctry>
(0018)     </Cdtr>
(0019)   </CdtrInf>
(0020)   <UltmtCdtr>
(0021)     <AdrTp></AdrTp>
(0022)     <Name></Name>
(0023)     <StrtNmOrAdrLine1></StrtNmOrAdrLine1>
(0024)     <BldgNbOrAdrLine2></BldgNbOrAdrLine2>
(0025)     <PstCd></PstCd>
(0026)     <TwnNm></TwnNm>
(0027)     <Ctry></Ctry>
(0028)   </UltmtCdtr>
(0029)   <CcyAmt>
(0030)     <Amt>200.00</Amt>
(0031)     <Ccy>CHF</Ccy>
(0032)   </CcyAmt>
(0033)   <UltmtDbtr>
(0034)     <AdrTp>K</AdrTp>
(0035)     <Name>Max Mustermann</Name>
(0036)     <StrtNmOrAdrLine1>Musterstrasse 28</StrtNmOrAdrLine1>
(0037)     <BldgNbOrAdrLine2>9000 St. Gallen</BldgNbOrAdrLine2>
(0038)     <PstCd></PstCd>
(0039)     <TwnNm></TwnNm>
(0040)     <Ctry>CH</Ctry>
(0041)   </UltmtDbtr>
(0042)   <RmtInf>
(0043)     <Tp>QRR</Tp>
(0044)     <Ref>444020220000022000100000002</Ref>
(0045)     <AddInf>
(0046)       <Ustrd>Z1Z2</Ustrd>
(0047)       <Trailer>EPD</Trailer>
(0048)       <StrdBkgInf></StrdBkgInf>
(0049)     </AddInf>
(0050)   </RmtInf>
(0051)   <AltPmtInf>
(0052)     <AltPmt>UV;UltraPay005;12345</AltPmt>
(0053)     <AltPmt>XY;XYService;54321\</AltPmt>
(0054)   </AltPmtInf>
(0055) </QRCH>


Generated by GEFEG.FX ---  http://www.gefeg.com/

Qr image no scissors

Hello,

it's there a way to print the QRBill without any scissors?
Because when printing on paper it does not alligne correcty with the pre-cut paper.

Thank you in advance.

Cheers,
Stefano

Custom logo

Would it possible to offer an option for a custom logo instead of a Swiss cross?

Add graphic to PDFCanvas()

Hi there

Is there a way to add a graphic (svg or png format) to a PDF e.g. for a company logo?
I haven't read anything in the JavaDocs or similar.

Thank you in advance.

Qrbill data is invalid

Fields for either structured address or combined element address may be filled but not both (address_type_confict).

This error occured when debtor.setaddressline1("") Or debtor.setaddressline1(null) in null condition sometimes works.

Please explain conditions for which this error can happen.

Issue is scanning QR code

Hi,

I could generate the QR Bill. But when I scan, only the address 1 line is getting scanned instead of entire bill information. Below is my QR Bill.

image

Validation 'Hinweis' @Postfinance 'Das Element 'AltPmt' darf nur geliefert werden, wenn es auch befüllt ist'

Bei der Validierung der QR Rechnung @ https://isotest.postfinance.ch/corporates/qrbill/validation
wird neu ein Hinweis liefert ausgegeben :
Hinweis : Das Element 'AltPmt' darf nur geliefert werden, wenn es auch befüllt ist.

Dies ist am 9.9.2021 noch nicht aufgetreten, Es scheint, dass sich die Validierung bei Postfinance geändert hat.

Der Hinweis wird einerseits mit neu generierten QR Rechnungen (QR-Bill Version 2.5.3) angezeigt, wird aber auch mit den Online Beispielen https://github.com/manuelbl/SwissQRBill ausgegeben.

Postfinance Validierungs Output :
Beispiel SwissQRBill.pdf.zip

Country code (wiki)

You write in the wiki:

And what about the country code? None of the examples shows a country. It's only part of the data embedded in the QR code. This library shows the country code at the start of the address line with postal code and town for all countries except Switzerland and Liechtenstein.

I had the same issue (https://github.com/swico/qr-bill/issues/1) and your choice makes perfect sense.

By the way, congratulations on your great work. I suggest that we link it from https://github.com/swico/qr-bill as a resource for developers looking for a well designed library.

Farbwahl Linien

Ist vermutlich momentan nicht relevant, solange nur in Schwarz gezeichnet wird:
Die Java-Methoden PDFCanvas::strokePath und PDFCanvas::fillPath enthalten die Zeilen
int r = (color >> 16) & 0xff;
int g = (color >> 8) & 0xff;
int b = (color >> 8) & 0xff;
D.h. g=b. Gemeint vermutlich
int b = color & 0xff

QR bill data is invalid: reference is invalid

I'm using your great library to generate QR code only for my QR-bill in PNG and I get an exception when generating the QR code:

net.codecrete.qrbill.generator.QRBillValidationError: QR bill data is invalid: reference is invalid (reference should be empty or start with "RF") (valid_iso11649_creditor_ref)

I generate the reference number using Payments.createQRReference() and it's formatted with Payments.formatQRReferenceNumber(). The generated string is a valid QR référence according to the standard.

00 00000 00000 00000 00000 00034

Export only the QRCode

is it possible to create an svg only with the QRCode and not with all the text on the left and right side?

UTF-8 validation again with https://validation.iso-payments.ch

Dear Manuel,

First of all congratulations about your great job and sharing it.

I have downloaded one of your PDF example (https://www.codecrete.net/qrbill/bill) and tried the validation tool from the above mentionned website (see title). As an example :
(0002) - Fatal error: Invalid UTF-8 byte sequence at byte 11 in the file. This is what the byte sequence looks like in ISO-8859-1 encoding: "öäüß{10}1 0 o". The first byte of this sequence was skipped and replaced by '�' in the output
Protocol.txt
.

Should I ignore these errors ?
Thank you for your help,
Kind Regards

Ignore Minor Version in Parsing

There is a new SIX Passus for parsing and validating the Version

Langfristig sollen die Teilnehmer nur die Hauptversion der IG, auf deren Grundlage der Swiss QR Code erstellt wird, validieren (z.B. «02»). Die Unterversion dient lediglich zu Informationszwecken und sollte nicht validiert werden (für die letzten zwei Zeichen sollten somit alle Eingaben – von «00» bis «99» – erlaubt sein). Diese Lösung soll mit dem ersten «Breaking Change», spätestens aber bis November 2022 von den Banken umgesetzt werden.

Is there a plan to implement this?

issue with latest pdfbox dependency (PDDocument.load)

Hi Manuel,

I have updated the QRbill to your latest version (was working very good in the past) and now i m facing some issues with the pdfbox dependency.
it seems pdfbox version 3.0.0 doenst have the load method anymore. This method is called when I use your library with the following statement
PDFCanvas canvas = new PDFCanvas(file, PDFCanvas.LAST_PAGE) which calls the PDDocument.load(pdfDocument) method.

which results in the following crash.
java.lang.NoSuchMethodError: org.apache.pdfbox.pdmodel.PDDocument.load([B)Lorg/apache/pdfbox/pdmodel/PDDocument;

I managed to fix this in restricting the pdfbox dependency to 2.0.23 in qrbill-generator-2.5.3.pom

<groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> <version>[2.0.23]</version> <scope>runtime</scope>

Ultimate Creditor information

Hello,

in QR implementation guide there is the possibility to define the creditor, implemented in the library, and the ultimate creditor that i can not find the implementation method.

Is it alreaby present? If not it will be implemented in future release?

Thank you in advance.
Knil

Reference validation

Commit 8fa5238 removed the following block of code (line 127 in Validator.java) from 'RF' reference validation

        if (reference.startsWith("RF")) {
            ...
        } else {
            ...

Now all RF references will be prepended with 000... and are flagged as invalid.

Please add shape-rendering to the SVG QR-Code

Since the QR code has only horizontal and vertical edges, it is important to set the 'shape-rendering' of the SVG to 'crispEdges'. This way the QR code is always sharply displayed, even if the SVG is reduced or enlarged. (no anti-aliasing).

This makes QR codes easier and faster to scan and screenshot tests more reliable.

Can someone please implement this in the SVG generator?
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering

Ränder zu EZ-Objekt auf 0 setzen / how to remove margins to qr-code object?

Offenbar werden zum EZ-Objekt automatisch "Ränder" (links und rechts) generiert.
Wie können diese entfernt werden?
Was ich versucht habe:
Dim EzAbschnitt As Bill = New Bill
EzAbschnitt.Format.Language = Language.DE ' Sprache setzen!
EzAbschnitt.Format.GraphicsFormat = GraphicsFormat.PNG ' Standard ist SVG
' Margins auf 0 setzen ' funktioniert so nicht - kein Unterschied
EzAbschnitt.Format.MarginLeft = 0
EzAbschnitt.Format.MarginRight = 0
Sprache und Grafikformat funktionieren, bei den Margins sehe ich keinen Unterschied (Standard oder auf 0 setzen))

Besten Dank!

PostFinance does not accept QR invoice with QR-IBAN displayed

PostFinance told one of our customers that the QR-IBAN should not be displayed to the client, instead the regular IBAN should be displayed. They rejected the QR invoice.

So this would create a QR invoice which has a Swiss QR reference, but displays a regular IBAN. Not sure if they mean that behind the QR code it uses the QR-IBAN but displays the regular IBAN on the invoice (we will have to check with PostFinance). But anyway, this is not possible with the SwissQRBill library, since it rejects the QR reference with a regular IBAN. And you cannot set an IBAN for display only, afaik.

It may very well be that PostFinance is wrong on this. In my opinion all the information that is displayed on the invoice must be exactly the same as the information behind the QR code. So we should display the QR-IBAN.

Any other experiences?

Support of in memory file system (e.g. jimfs) for unit tests

Hello Manuel

Thank you for your great library. I used it in my application and as an example for students at the technical university of Luzern.
I am using an in-memory file system (jimfs) to implement unit and integration tests together with JUnit 5.

Would it be possible to alter the code of the constructor

public PDFCanvas(Path path, int pageNo) throws IOException {
setupFontMetrics(PDF_FONT);
document = PDDocument.load(path.toFile());
preparePage(pageNo);
}

into

public PDFCanvas(Path path, int pageNo) throws IOException {
setupFontMetrics(PDF_FONT);
document = PDDocument.load(Files.newInputStream(path);
preparePage(pageNo);
}

(PDFDocument already provides a method with an input stream)

Path class supports other file systems (such as jimfs) but File class is a legacy class only supporting the default file system.

Thanks in advance for looking at it.

Sincerely

Marcel

Dauerauftrag

Is it possible to set the payment not as just one time, instead as a weekly / monthly recurring payment?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.