Skip to content

Commit

Permalink
Update Resume.java
Browse files Browse the repository at this point in the history
Updated URL
  • Loading branch information
StevenStreasick authored Aug 7, 2024
1 parent 71ab66d commit f6138af
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/main/java/com/Resume/Resume.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Resume {

//The font path
private final static String FONTPATH = "fonts";
private final static String REPOURI = "https://github.com/StevenStreasick/Resume";
private final static String REPOURI = "https://github.com/StevenStreasick/Resume/blob/main/README.md";
/**
* Sets the fonts that will be used
*
Expand Down Expand Up @@ -87,35 +87,35 @@ private boolean createFonts() {
* @return {@code BufferedImage} storing the QR code
*/
private static BufferedImage createQRCode(String URI) {
int scalar = 16;
int scalar = 16;

QrCode.Ecc errorCorrectionLevel = QrCode.Ecc.LOW;
QrCode qrCode = QrCode.encodeText(REPOURI, errorCorrectionLevel);
QrCode.Ecc errorCorrectionLevel = QrCode.Ecc.LOW;
QrCode qrCode = QrCode.encodeText(REPOURI, errorCorrectionLevel);

int matrixSize = qrCode.size * scalar;
int matrixSize = qrCode.size * scalar;

BufferedImage image = new BufferedImage(matrixSize, matrixSize, BufferedImage.TYPE_INT_RGB);
image.createGraphics();
BufferedImage image = new BufferedImage(matrixSize, matrixSize, BufferedImage.TYPE_INT_RGB);
image.createGraphics();

//-----Fill the background with white------
Graphics2D graphics = (Graphics2D) image.getGraphics();
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, matrixSize, matrixSize);

//-----Fill the background with white------
Graphics2D graphics = (Graphics2D) image.getGraphics();
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, matrixSize, matrixSize);

//------Add the black dots to make up the QR code
graphics.setColor(Color.BLACK);

for (int x = 0; x < qrCode.size; x++) {
for (int y = 0; y < qrCode.size; y++) {
if (!qrCode.getModule(x, y)) { continue; }

graphics.fillRect(x * scalar, y * scalar, scalar, scalar);

}
}

//------Add the black dots to make up the QR code
graphics.setColor(Color.BLACK);

for (int x = 0; x < qrCode.size; x++) {
for (int y = 0; y < qrCode.size; y++) {
if (!qrCode.getModule(x, y)) { continue; }

graphics.fillRect(x * scalar, y * scalar, scalar, scalar);

}
}

return image;
return image;
}


Expand Down Expand Up @@ -320,7 +320,7 @@ private PdfPTable createHeader() {
Image qrCodeImage = Image.getInstance(baos.toByteArray());

//Scale the QR code. Create the QR code big, then scale down for clarity reasons.
qrCodeImage.scalePercent(9.6f);
qrCodeImage.scalePercent(8.6f);
//Add the QR code image to the container
qrCode = new PdfPCell(qrCodeImage);

Expand Down

0 comments on commit f6138af

Please sign in to comment.