Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhougaofeng
magic_pdf
Commits
56f741c2
"vscode:/vscode.git/clone" did not exist on "b93fe085459ae0327e9177a6f871172f1cebceab"
Commit
56f741c2
authored
Oct 24, 2024
by
zhougaofeng
Browse files
Update pdf_client.py
parent
dcbab82f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
magic_pdf/parse/pdf_client.py
magic_pdf/parse/pdf_client.py
+2
-3
No files found.
magic_pdf/parse/pdf_client.py
View file @
56f741c2
...
@@ -13,15 +13,14 @@ class ocrPdfClient:
...
@@ -13,15 +13,14 @@ class ocrPdfClient:
def
__init__
(
self
,
api_url
):
def
__init__
(
self
,
api_url
):
self
.
api_url
=
api_url
self
.
api_url
=
api_url
def
ocr_pdf_client
(
self
,
path
,
output_dir
,
config_path
):
def
ocr_pdf_client
(
self
,
path
,
output_dir
):
payload
=
{
payload
=
{
"path"
:
str
(
path
),
"path"
:
str
(
path
),
"output_dir"
:
str
(
output_dir
),
"output_dir"
:
str
(
output_dir
),
"config_path"
:
str
(
config_path
)
}
}
file_name_without_extension
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
path
))
file_name_without_extension
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
path
))
logger
.
info
(
logger
.
info
(
f
'pdf_server:
{
self
.
api_url
}
, pdf path:
{
path
}
, config path:
{
config_path
}
'
f
'pdf_server:
{
self
.
api_url
}
, pdf path:
{
path
}
'
)
)
try
:
try
:
response
=
requests
.
post
(
f
"
{
self
.
api_url
}
/pdf_ocr"
,
json
=
payload
)
response
=
requests
.
post
(
f
"
{
self
.
api_url
}
/pdf_ocr"
,
json
=
payload
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment