-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance auto-rename functionality with additional options #1604
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package stirling.software.SPDF.model.api.misc; | ||
|
||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import lombok.Data; | ||
|
@@ -16,4 +18,9 @@ public class ExtractHeaderRequest extends PDFFile { | |
required = false, | ||
defaultValue = "false") | ||
private boolean useFirstTextAsFallback; | ||
|
||
private MultipartFile fileInput; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fileInput already included via extended PDFFile |
||
private String keyword; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any API documentation for these? |
||
private Boolean useAfter; | ||
private Integer linesToCheck; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,29 @@ | |
<form method="post" enctype="multipart/form-data" th:action="@{'/api/v1/misc/auto-rename'}"> | ||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div> | ||
<br> | ||
<div class="form-group"> | ||
<label for="keyword">Keyword:</label> | ||
<input type="text" class="form-control" id="keyword" name="keyword" placeholder="e.g., Company, Name, Invoice" required> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about if people want to auto grab the title without using any keywords like previous functionality, we still need to support that and make it clear to use this is option, |
||
</div> | ||
<br> | ||
<div class="form-group"> | ||
<label for="useAfter">Text to use:</label> | ||
<select class="form-control" id="useAfter" name="useAfter"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be good to support text before key word, and or regex as well |
||
<option value="false">Entire line containing keyword</option> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all text should use translation feature ie |
||
<option value="true">Text after keyword</option> | ||
</select> | ||
</div> | ||
<br> | ||
|
||
<div class="form-group"> | ||
<label for="linesToCheck">Number of Lines to Check:</label> | ||
<input type="number" class="form-control" id="linesToCheck" name="linesToCheck" value="10" min="1"> | ||
</div> | ||
<br> | ||
|
||
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{auto-rename.submit}"></button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this multiFile input is already part of this class... its from PDFFile that's extended