Problem trying to move content to the right

I’m experiencing the following issue. When trying to place text that is more right-aligned than an A4 sheet, basically, I’m running into a possible limit, which prevents the content from being further to the right.

I tried to follow the one mentioned below, but by leaving the right margin of 5px, it is not possible. However, I didn’t have the same problem when trying to align to the left.

I’m using version 21.7.0 of Aspose PDF

Set PDF Dimensions and Margins - Free Support Forum - aspose.com

@eriky

Would you please share the same code snippet and the sample file that you are using for this case at your end? We will test the scenario in our environment and address it accordingly. If possible, please share screenshot of the issue so that we can better understand it.

I won’t be able to share the code, but the part I’m referring to is like this. The same works with the margin on the left, but it doesn’t work on the right.

Parte 1:
TableElement tableElement = taggedContent.createTableElement();
tableElement.setColumnWidths(“60 194 100 180”);
tableElement.setDefaultCellPadding(new MarginInfo(-40.0, -60.0, -40.0, -20.0));
tableElement.getTable().setAlignment(HorizontalAlignment.Right);
rootElement.appendChild(tableElement);

Parte 2:
ParagraphElement line = taggedContent.createParagraphElement();
line.getStructureTextState().setForegroundColor(Color.getBlack());
line.getStructureTextState().setFont(FontRepository.findFont(“Arial”));
line.getStructureTextState().setFontStyle(1);
line.getStructureTextState().setFontSize(8.5F);
Rectangle rectangle = new Rectangle(0.0, 0.0, 0, 20.0);
line.getTextFragment().setRectangle(rectangle);
line.getStructureTextState().setMarginInfo(new MarginInfo(0.0, 1.0, -800.0, 0.0));
line.setText(“\n_________________________________________________________________________________________________________________________________________”);
TableTHElement thLine = tr2.createTH();

Captura de tela 2024-06-04 082947.png (1,2,KB)

What’s highlighted, in red, in the image is the space where I want to enlarge the line, so that the margins are equal.

@eriky

Thanks for the details shared above. We are afraid that these details are not sufficient to completely understand and replicate the issue in our environment. In order to address the issue, we need to be able to replicate it in our environment with respective sample file. If you can share enough information or a sample console application for our reference, we will further proceed accordingly.