testPondiversedeleteCreation2 matches
41// New: Replace the title, type and data with a message
42await sqlite.execute(
43`UPDATE ${TABLE_NAME} SET title = "Creation deleted by moderator", type = "", data = "", image = "" WHERE id = ?;`,
44[id],
45);
4647// Also delete the blob!
48blob.delete("pondiverse_image" + id);
49blob.delete("pondiverse_data" + id);
50
mfe-demoindex.html1 match
6<title>React Hono Val Town Starter</title>
7<link rel="stylesheet" href="/frontend/style.css">
8<link rel="icon" href="/frontend/favicon.svg" type="image/svg+xml">
9</head>
10<body>
discord-metadatamain.ts1 match
54<meta content="${url}" property="og:url" />
55<meta name="theme-color" content="${color}">
56<meta name="twitter:card" content="summary_large_image"/>
5758Nothing to see here
33app.post("/api/merge", handleMerge);
34app.post("/api/split", handleSplit);
35app.post("/api/pdf-to-images", handleConvert);
36app.post("/api/images-to-pdf", handleConvert);
37app.post("/api/compress", handleCompress);
38app.post("/api/watermark", handleWatermark);
pdfconvert.ts24 matches
16const operation = c.req.path.split('/').pop();
17
18if (operation === 'pdf-to-images') {
19return await handlePdfToImages(files, settings);
20} else if (operation === 'images-to-pdf') {
21return await handleImagesToPdf(files, settings);
22}
23
32}
3334async function handlePdfToImages(files: File[], settings: any): Promise<Response> {
35if (files.length !== 1) {
36return createErrorResponse("Exactly one PDF file is required");
42}
4344// Note: PDF to image conversion requires a more complex library like pdf2pic
45// For now, we'll return a placeholder response
46return createJsonResponse({
47success: false,
48error: "PDF to image conversion is not yet implemented. This requires additional libraries for rendering PDF pages to images."
49});
50}
5152async function handleImagesToPdf(files: File[], settings: any): Promise<Response> {
53if (files.length === 0) {
54return createErrorResponse("At least one image file is required");
55}
5657// Validate image files
58const validImageTypes = ['image/png', 'image/jpeg', 'image/jpg'];
59for (const file of files) {
60if (!validImageTypes.includes(file.type)) {
61return createErrorResponse(`Invalid image file: ${file.name}. Only PNG and JPG are supported.`);
62}
63}
66
67for (const file of files) {
68const imageBytes = await fileToArrayBuffer(file);
69
70let image;
71if (file.type === 'image/png') {
72image = await pdfDoc.embedPng(imageBytes);
73} else {
74image = await pdfDoc.embedJpg(imageBytes);
75}
76
77// Create a page with the image
78const page = pdfDoc.addPage([image.width, image.height]);
79page.drawImage(image, {
80x: 0,
81y: 0,
82width: image.width,
83height: image.height,
84});
85}
86
87const pdfBytes = await pdfDoc.save();
88const filename = `images-to-pdf-${Date.now()}.pdf`;
89
90return createDownloadResponse(pdfBytes, filename);
pdfProcessingArea.tsx1 match
63);
6465case 'pdf-to-images':
66return (
67<div className="space-y-4">
pdfindex.html1 match
7<script src="https://cdn.twind.style" crossorigin></script>
8<script src="https://esm.town/v/std/catch"></script>
9<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📄</text></svg>">
10<style>
11.file-drop-zone {
74},
75{
76id: 'pdf-to-images',
77name: 'PDF to Images',
78description: 'Convert PDF pages to PNG or JPG images',
79icon: '🖼️',
80acceptedFiles: ['.pdf']
81},
82{
83id: 'images-to-pdf',
84name: 'Images to PDF',
85description: 'Convert images to PDF format',
86icon: '📸',
87acceptedFiles: ['.png', '.jpg', '.jpeg'],
7- **Merge PDFs**: Combine multiple PDF files into one
8- **Split PDF**: Extract specific pages or split into separate files
9- **PDF to Images**: Convert PDF pages to PNG/JPG images
10- **Images to PDF**: Convert images to PDF format
11- **Compress PDF**: Reduce PDF file size
12- **Add Watermark**: Add text or image watermarks
13- **Extract Text**: Extract text content from PDFs
14- **Rotate Pages**: Rotate PDF pages
50511. Select a PDF operation from the tool menu
522. Upload your PDF file(s) or images
533. Configure operation settings
544. Process and download the result