Please try setTextAlignment method:
Paragraph paragraph1 = new Paragraph(str1);
paragraph1.setTextAlignment(TextAlignment.RIGHT);
document.add(paragraph1);
It's important to mention that setHorizontalAlignment and setTextAlignment methods have different goals. The former is about placing the paragraph itself (as an element) and the latter is about placing its content.
To see the difference one can set width on a paragraph and add that paragraph to a div element.
I've created a small test to demonstrate it:
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document document = new Document(pdfDocument);
Div div = new Div()
.setWidth(500)
.setBackgroundColor(ColorConstants.YELLOW);
Paragraph paragraph = new Paragraph("Hello World!")
.setTextAlignment(TextAlignment.CENTER)
.setHorizontalAlignment(HorizontalAlignment.RIGHT)
.setWidth(300)
.setBackgroundColor(ColorConstants.BLUE);
div.add(paragraph);
document.add(div);
As you can see, here I've created a paragraph with horizontal alignment set as RIGHT and text alignment set as CENTER.
The result looks the next way: