Swift Save UITextView Text to .Pdf, .Doc and .Txt file formate and Display

My Scenario, I am trying to save UITextView Text with Three format .Pdf, .doc and .txt. Here, formate option user can choose based on alert option. Once Its saved need to show in Preview controller for file sharing. How to achieve this?

func createPDF(text:String, filename:String) {          // 1. Create Print Formatter with input text.         let formatter = UIMarkupTextPrintFormatter(markupText: text)          // 2. Add formatter with pageRender         let render = UIPrintPageRenderer()         render.addPrintFormatter(formatter, startingAtPageAt: 0)          // 3. Assign paperRect and printableRect         let page = CGRect(x: 0, y: 0, width: 595.2, height: 841.8) // A4, 72 dpi         let printable = page.insetBy(dx: 0, dy: 0)          render.setValue(NSValue(cgRect: page), forKey: "paperRect")         render.setValue(NSValue(cgRect: printable), forKey: "printableRect")          // 4. Create PDF context and draw         let rect = CGRect.zero          let pdfData = NSMutableData()         UIGraphicsBeginPDFContextToData(pdfData, rect, nil)          for i in 1...render.numberOfPages {             UIGraphicsBeginPDFPage();             let bounds = UIGraphicsGetPDFContextBounds()             render.drawPage(at: i - 1, in: bounds)         }         UIGraphicsEndPDFContext();          // 5. Save PDF file         let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]         pdfData.write(toFile: "\(documentsPath)/\(filename).pdf", atomically: true)         print("saved success:\(documentsPath)\(filename)")         listFiles()     } 

Extensão .pdf não baixa em download de php

Boa noite,

Eu tenho uma tabela no banco de dados que cadastra arquivos(pdf,img,png e etc…) chamada

boletos:

CREATE TABLE boletos (   protocolo int(11) NOT NULL AUTO_INCREMENT,  boleto mediumblob NOT NULL,  nomeBoleto varchar(20) DEFAULT NULL,  tipoBoleto varchar(20) DEFAULT NULL,  PRIMARY KEY (protocolo)); 

Consegui fazer o cadastro em bytes[] dos arquivos e puxar do banco e fazer o download, todos os arquivos baixam perfeitamente, somente o pdf que não baixa com a extensão dele (.pdf), ele baixa com a extensão de (todos os arquivos) e eu tenho que clicar em cima para escolher para ele abrir em pdf, alguém sabe pq isso acontece só com o pdf, meu codigo está assim:

download.php:

<?php include "config.php"; // Define o tempo máximo de execução em 0 para as conexões lentas     set_time_limit(100);  $  GerParam=filter_input(INPUT_GET, "protocolo" ,FILTER_DEFAULT); if(isset($  _GET['protocolo'])){      $  protocolo = $  _GET['protocolo'];      $  stat = $  db->prepare("SELECT nomeBoleto,tipoBoleto,boleto FROM boletos WHERE protocolo=?");      $  stat->execute(array($  _GET['protocolo']));     $  stat->bindColumn(1, $  nomeBoleto, PDO::PARAM_STR, 256);     $  stat->bindColumn(2, $  tipoBoleto, PDO::PARAM_STR, 256);     $  stat->bindColumn(3, $  boleto, PDO::PARAM_LOB);     $  stat->fetch(PDO::FETCH_BOUND);                  header('Accept-Ranges: bytes');                 header('Content-Transfer-Encoding: binary');                 header("Content-Type: $  tipoBoleto");                  header("Content-Disposition: attachment; filename=$  nomeBoleto");                 echo $  boleto;   }  ?> 

Todos baixam com a extensão certa só o pdf que não…

Making a linux script that retreives .PDF extension files from a website

This is a lil off topic but will be suitable for linux forum with a mix of programming. I want to make a script that automatically extracts and finds me all the pdf present in a given website and download it in a user defined directory. Here i do not want to use wget and curl command as it is time taking and will be a hectic work when downloading a large ammount of file from a website. Maybe the script could automatically also. I am new to programming so can anyone help me?

.docx OR .pdf search only returning PDF docs

I am trying to get PDF and DOCX documents marked with a status “Ready” or “Checked” or “Approved””

The part of the URL searching for the status is:

&FilterField1=Status&FilterValue1=Ready&FilterType1=Choice&FilterOp1=In&view=7

The part of the URL searching for the doctype is:

However: &q=%2Epdf%20OR%20%2Edocx (first PDF then DOCX) returns only PDF files

&q=%2Edocx%20OR%2Epdf (first Docx then Pdf) returns only PDF files as well

&q=%2Edocx%20 (only Docx) returns DOCX documents

Why is DOCX skipped when used in combination with PDF?

By the way &q=%2Edocx%20OR%2xls gives DOCX and XLSX documents…..

I have tried this on 2 sharepoint sites and both return the same results.

Yours

Gert

Data Transfer from .pdf to word or excel with low cost for $5

Data entry from websites to Excel Data entry from PDF files to Excel Data entry from image files to Excel Data entry from Word to Excel Splitting and merging Excel files Splitting name and address fields in Excel into separate fields Formatting of Word documents Creating Excel charts Searchable Data Validation in excel/ Date Picker and other features In Word/Excel. Can Type illegible documents (I am Expert on this type of Job) Word document fillable but not editable. Find Emails/Contact Details from Website A good command of MS Office skills (Excel, Word,PowerPoint) De-duplicating and cleaning up Excel files Can use slicers and build the Dash-Board accordingly. Can do the -automate Data Filling forms Can do basic business Reports.

by: QualityTeam
Created: —
Category: Data Entry
Viewed: 193