Generate blank omr

this is my .txt source

?empty_line=
height=1
columns_proportions=49%-2%-49%
block_top_padding=0
block_bottom_margin=0
block_right_margin=0
?block=
column=1
?content=NEET SAMPLE
color=Orange
align=left
font_size=24
?content=OMR Sheet 2022
color=Orange
align=left
font_size=16
&block
?block=
column=3
?paragraph=
type=Inline
vertical_align=center
?paragraph=text
?content=Aspose OMR
color=Black
font_size=18
align=center
?content=Best OMR solutions for you
color=Black
font_size=8
align=center

&block
?container=Persons info
columns_proportions=50%-50%
block_top_padding=0
block_bottom_margin=0
block_right_margin=0
?block=left name
column=1
?container=left name wrapper
columns_count=1
block_top_padding=0
block_bottom_margin=0
block_right_margin=0
?block=
column=1
background_color=Moccasin
border_color=Orange
border=square
border_size=5
?content=Candidate’s Name
color=Orange
font_size=12
font_style=bold
&block
?block=Name
column=1
border=square
border_size=5
border_color=Orange
is_clipped=true
?empty_line=
height=20
?content=_____________________________________
font_size=14
color=orange
&block
&container
&block
&container=
?block=left signatures
column=1
?container=
columns_count=1
block_top_padding=0
block_bottom_margin=0
block_right_margin=0
?block=Student Signature
column=1
border=square
border_size=5
border_color=Orange
is_clipped=true
?empty_line=
height=110
?content=Student Signature
color=Orange
font_size=6
font_style=bold
align=right
&block
?block=Invigilator Signature
column=1
border=square
border_size=5
border_color=Orange
is_clipped=true
?empty_line=
height=110
?content=Invigilator Signature
color=Orange
font_size=6
font_style=bold
align=right
&block
?block=Thumbprint
column=1
border=square
border_size=5
border_color=Orange
is_clipped=true
?empty_line=
height=110
?content=Candidate’s left hand thumb impression
color=Orange
font_size=6
font_style=bold
align=right
&block
&container
&block
?block=right UID
column=2
?container=
columns_proportions=25%-1%-25%-1%-22%-1%-25%
block_top_padding=0
block_bottom_margin=0
block_right_margin=0
?block=
column=1
background_color=Moccasin
border_color=Orange
border=square
border_size=5
?content=Candidate ID
color=Orange
font_size=6
font_style=bold
&block
?block=Candidate UID
column=1
border=square
border_size=5
border_color=Orange
is_clipped=true
?empty_line=
height=10
?composite_grid=Candidate UID
display_hint=false
header_type=Square
header_border_color=Orange
align=center
columns_count=4
bubble_size=extrasmall
values=(0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
&block
?block=
column=3
border=square
border_size=5
border_color=Orange
background_color=Moccasin
?content=Centre Code
color=Orange
font_size=6
font_style=bold
&block
?block=
column=3
border=square
border_size=5
border_color=Orange
?empty_line=
height=10
?composite_grid=Centre Code
display_hint=false
header_type=Square
header_border_color=Orange
align=center
columns_count=4
bubble_size=extrasmall
values=(0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
&block
?block=
column=5
border=square
border_size=5
border_color=Orange
background_color=Moccasin
?content=Roll No.
color=Orange
font_style=bold
font_size=6
&block
?block=
column=5
border=square
border_size=5
border_color=Orange
?empty_line=
height=10
?composite_grid=Roll No.
display_hint=false
header_type=Square
header_border_color=Orange
align=center
columns_count=4
bubble_size=extrasmall
values=(0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
&block
?block=
column=7
border=square
border_size=5
border_color=Orange
background_color=Moccasin
?content=Marks (%)
color=Orange
font_style=bold
font_size=6
&block
?block=
column=7
border=square
border_size=5
border_color=Orange
?empty_line=
height=10
?composite_grid=11th Marks (%)
display_hint=false
header_type=Square
header_border_color=Orange
align=center
columns_count=2
bubble_size=extrasmall
values=(0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
&block
&container
&block
&container
?container=QuestionsWrapper
columns_count=1
?block=
column=1
?custom_answer_sheet=Section 1
border=rounded
amount=180
columns_count=5
row_proportions=20%-80%
border_color=DarkOrange
?header=123
?column=QNo.
font_size=6
font_style=bold
align=center
?column=Answer Options
font_size=6
font_style=bold
align=center
&header
?custom_row=row_%index%
?content=%index%
font_size=6
align=center
?bubble_array=b_%index%
answers_list=(A)(B)(C)(D)(E)
bubble_size=extrasmall
font_size=6
&custom_row
&custom_answer_sheet
&block
&container

This is my service public String generateOMR(MultipartFile sourceFile, String fileName) {
try {
createDirectories();
String sourceFilePath = saveUploadedFile(sourceFile);
LoadLicenseFromFile.run();
OmrEngine engine = new OmrEngine();
GenerationResult result = engine.generateTemplate(sourceFilePath);
result.save(OUTPUT_DIR, fileName);

        return "Form generated successfully";
    } catch (Exception e) {
        return "Error generating form: " + e.getMessage();
    }
}   

Now problem is when I generate it generate blank omr sheet
neettest.jpg (36.4 KB)

@amarschool

It seems that you are encountering an issue where the generated OMR sheet is blank. This can happen for several reasons, and I will guide you through some troubleshooting steps to help resolve this issue.

  1. Check the Source File: Ensure that the content in your .txt source file is correctly formatted according to the specifications required by the Aspose OMR library. Any syntax errors or misconfigurations in the markup can lead to a blank output.

  2. Verify the File Path: Make sure that the path to the source file is correct when you are saving it. If the file is not found or not accessible, the OMR engine will not be able to generate the template.

  3. Inspect the Generation Result: After calling the generateTemplate method, check the GenerationResult object for any error codes. If there are errors, they can provide insight into what went wrong during the generation process. You can add a check like this:

    if (result.getErrorCode() != 0) {
        System.out.println("ERROR CODE: " + result.getErrorCode());
    }
    
  4. Output Directory: Ensure that the output directory where you are saving the generated OMR sheet is correctly set up and writable. If the application does not have permission to write to the specified directory, the output will not be saved.

  5. Testing with Sample Files: Try generating the OMR sheet using a known working sample file provided in the Aspose OMR examples. This can help determine if the issue lies with your specific markup or the generation process itself.

  6. Review Documentation: It may be helpful to review the official documentation or examples provided by Aspose OMR to ensure that your implementation aligns with the expected usage.

If you follow these steps and still encounter issues, please provide any error messages or additional details about your setup, and I would be happy to assist further!

Sources:
[1]: GenerateOMRTemplate.java

when I want to add container, block, empty line then it generate Blank page but if I use only answer_sheet then it generate properly. now I want to generate custom OMR sheet .

Hello, @amarschool

I have noticed that in thread tags there is a mention of Aspose OMR for Java.

Unfortunately, at the current moment, Java version has very limited API.

More complex layout element (container\block\paragraph) as well as behavior patterns (wrap\clip) - only available on .NET or Cloud solutions.

Thanks a lot