def pdf_to_png(pdf_path, poppler_path, dpi=300):
images = convert_from_path(pdf_path, dpi=dpi, poppler_path=poppler_path)
image_paths = []
for i, image in enumerate(images):
image_path = f"page_{i+1}.png"
image.save(image_path, "PNG")
image_paths.append(image_path)
return image_paths
def png_to_pdf(image_paths, output_pdf, dpi=300):
pdf = None
for image_path in image_paths:
image = Image.open(image_path)
width, height = image.size
width_pt = width * 72 / dpi
height_pt = height * 72 / dpi
if pdf is None:
pdf = FPDF(unit="pt", format=[width_pt, height_pt])
pdf.add_page()
pdf.image(image_path, 0, 0, width_pt, height_pt)
pdf.output(output_pdf, "F")
def convert_pdf_to_pdf(pdf_path, output_pdf, poppler_path, dpi=300):
image_paths = pdf_to_png(pdf_path, poppler_path, dpi)
png_to_pdf(image_paths, output_pdf, dpi)
pdf_path = "form.pdf" # Path to the input PDF
output_pdf = "output.pdf" # Path to the final PDF
poppler_path = r"C:\\poppler-24.08.0\\Library\\bin"
convert_pdf_to_pdf(pdf_path, output_pdf, poppler_path)
print("Conversion complete!")
let lastInputTime = 0;
let isScannerInput = false;
$('input[name=search_content]').on('keydown', function(event) {
clearTimeout(inputTimer);
let now = Date.now();
if (now - lastInputTime < 50) { // Если разница между нажатиями маленькая, считаем, что это сканер
isScannerInput = true;
} else {
isScannerInput = false;
}
lastInputTime = now;
if (isScannerInput) {
event.preventDefault();
event.stopPropagation();
}
inputTimer = setTimeout(function(field) {
var v = $('input[name="search_content"]').val();
var res = /\/+/g.test(v);
if(res){
searchQr($('input[name="search_content"]').val());
$('input[name="search_content"]').val('');
} else {
if(event.keyCode == 13) {
show_stage(1);
}
}
}, 500);
});
[03.02.2025 / 16:31:55] Task " is completed. Result: 31/35. User is: 1369
[03.02.2025 / 14:14:47] Task " is completed. Result: 14/17. User is: 1322
[31.01.2025 / 16:27:18] Task " is completed. Result: 22/25. User is: 1322
[31.01.2025 / 16:01:32] Task " is completed. Result: 9/9. User is: 1369
[30.01.2025 / 15:52:53] Task " is completed. Result: 45/58. User is: 1369
[29.01.2025 / 15:12:49] Task " is completed. Result: 40/44. User is: 1369
$largest = [];
foreach ($this->keywords[$a] as $key => $arr) {
for ($c = 0; $c < count($this->keywords[$a]); $c++) {
$k = array_search($arr[0], $this->keywords[$a][$c]);
if ($k !== false && $c != $key) {
if (count($this->keywords[$a][$c]) > count($largest)) {
$largest = $this->keywords[$a][$c];
}
}
}
}
foreach ($this->keywords[$a] as $key => $arr) {
foreach($largest as $add_word){
if(!in_array($add_word, $arr)){
$this->keywords[$a][$key][] = '-'.$add_word;
}
}
}
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/free/link')
def free_forLink():
#обработка запроса при обращении по адресу бота /free/link
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
def blablabla(message):
#Код обработки функции blablabla
def blablabla2(message):
#Код обработки функции blablabla2
if message.text = "О нас":
message = 'qq World'
blablabla(message)
else:
message = 'qq World2'
blablabla2(message)
<script>
var yaParams = 'ip: <? echo $_SERVER['REMOTE_ADDR']; ?>';
console.log(yaParams);
</script>
<html>
<head>
<style>
body{
overflow:hidden;
height:100vh;
}
.overflow{
min-height:100vh;
overflow-y:auto;
}
</style>
</head>
<body>
<div class=“overflow”>
Content
<div>
</body>
</html>
<html>
<head>
<style>
body{
display:grid;
overflow:hidden;
height:100vh;
grid-template-columns:200px auto;
}
.no-overflow{
}
.overflow{
min-height:100vh;
overflow-y:auto;
}
</style>
</head>
<body>
<div class=“no-scroll”>
Leftblock
</div>
<div class=“overflow”>
Content
<div>
</body>
</html>