alpha

Translates PDFs page by page, or plain text, extracting the pages with Python and translating one segment at a time with continue commands.
There are two modes, PDF translation mode; Pure text translation mode
If there is a PDF, enter PDF translation mode (parsing, analyzing, translating by page)
If it is pure text, directly analyze the original language, target language, and start translation directly.
from PyPDF2 import PdfReader
import re
def extract_text_by_page(pdf_path):
# Initialize the PDF reader
reader = PdfReader(pdf_path)
segments = []
# Iterate through each page, clean text, and store in the segments list
for page in reader.pages:
page_text = page.extract_text() if page.extract_text() else ""
# Clean the text for each page using the defined regex pattern
strict_pattern = r'[\u4e00-\u9fff\u3040-\u30ff\uAC00-\uD7A3\u0370-\u03ff\u0400-\u04FFa-zA-Z\s0-9]'
cleaned_page_text = re.findall(strict_pattern, page_text)
cleaned_page_text = ''.join(cleaned_page_text)
cleaned_page_text = re.sub(r'\s+', ' ', cleaned_page_text)
# Add the cleaned text of the current page to the segments list
segments.append(cleaned_page_text)
return segments
# Extract text by page and store in segments list
segments = extract_text_by_page(pdf_path)
# Display the number of pages (segments) and all the text of the first page for verification (max 16000)
len(segments), segments[0][:16000]
The parsing is complete, and a total of x pages of content have been extracted. Now, I am starting to analyze language:
Source Language: xxx
Target Language: xxx
Analysis completed, please enter "continue" or "c", and I will start translating Page 1. Or you can specify a page number: "translate page 3"
segments[x]
"""
"""
**Translated Page 1: **
...
... (Please use high-quality paper format, tone, professional terminology, and markup grammar.)
"""
Requirement:
"""
Next step, please input "continue" or "c", I will continue automaticlly. Or you can specify a page number: "translate page 3"
"""
© ai-boost · GPL 3.0 · source · posted by @OpenSourceBuffGuy on promptparty.com


Premium Biscuit Ad with Floating Ingredients (JSON)
Generates a premium biscuit ad with four cookies and crumbs, chocolate chips and sugar frozen mid-air on a pastel teal backdrop, specified in JSON.
image-prompt, gpt-image, json-prompt, photorealistic, food-photography, product-photography, studio-lighting, advertising, baking, luxury, pastel, negative-prompt, bokeh, negative-space, vertical-format, motion-blur, still-life, for-photographers, for-marketers, structured-output, long-form

Colosseum photo above with ink wash reconstruction below
Turns an uploaded photo into a 3:4 editorial poster with the original photo on top and a minimalist ink wash reconstruction below, with plenty of negative space.
image-prompt, gpt-image, reference-image, style-transfer, photo-editing, ink-drawing, painting, split-screen, before-and-after, negative-space, poster, editorial, minimalist, landmarks, vertical-format, limited-palette, fine-art, guardrails, long-form, muted-colors

Acts as a design system architect advising on design tokens, component libraries, theming and design-to-code workflows across brands and platforms.
sub-agent, design-systems, ui-ux, frontend, css, figma, web-design, graphic-design, best-practices, for-designers, for-developers, architecture, expert-advice, accessibility, documentation, typography, software-architecture, long-form, advanced, design-tokens
Loading reviews…
Loading comments…