Xamarin Extract Images from pdf file [closed] - image

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a pdf file in my server and i want a method to download the pdf file and extract images from that file. So far i have used XamiTextSharpLGPLv2, pdfbox but no luck so far.
PdfReader reader = new PdfReader(new Uri(url));
for (int i = 1; i <= reader.NumberOfPages; i++)
{
PdfDictionary pg = reader.GetPageN(i);
iTextSharp.text.pdf.PdfObject PDFObj = reader.GetPdfObject(i);
if ((PDFObj != null) && PDFObj.IsStream())
{
iTextSharp.text.pdf.PdfStream PDFStremObj = (iTextSharp.text.pdf.PdfStream)PDFObj;
try
{
//var pdfImage = new PdfImageObject((PRStream)PDFStremObj);
//var img = pdfImage.GetDrawingImage();
}
catch (Exception)
{
}
}
}
PdfImageObject is not found in XamiTextSharpLGPLv2,
how can i use XamiTextSharpLGPLv2 to extract images or suggestions for any other library to achieve this would be a great help.
Thanks in advance.

Xamarin Extract Images from pdf file
here are two libraries to extract images from pdf file
XFINIUM.PDF
PDFTron

Related

Xamarin.forms Get the token after logging in [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Sorry for my poor language. I would like to know how to get the token after logging in in xamarin.forms. I enter my email and password in postman, it generates the token visible at the bottom
I authorize myself by entering Bearer + token
You can use HttpClient to Consume a RESTful Web Service and get the token from the response:
public async void test() {
var client = new HttpClient();
string jsonData = #"{""username"" : ""myusername"", ""password"" : ""mypassword""}";
var content = new StringContent(jsonData, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync("your request url", content);
// this result string should be something like: "{"token":"rgh2ghgdsfds"}"
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}

Spring Webflux Upload Large Image File and Send The File with WebClient in Streaming Way [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am using spring webflux functional style.
I want to create a endpoint which accepts large image files and send this files to another service with webClient in streaming way.
All file processing should be in streaming way because I don't want to my app crush because of outofmemory.
Is there anyway to do this ?
Probably something like this:
#PostMapping(value = "/images/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public Mono<ResponseEntity<Void>> uploadImages(#RequestPart("files") Flux<FilePart> fileParts) {
return fileParts
.flatMap(filePart -> {
return webClient.post()
.uri("/someOtherService")
.body(BodyInserters.fromPublisher(filePart.content(), DataBuffer.class))
.exchange()
.flatMap(clientResponse -> {
//some logging
return Mono.empty();
});
})
.collectList()
.flatMap(response -> Mono.just(ResponseEntity.accepted().build()));
}
This accepts MULTIPART FORM DATA where you can attach multiple image files and upload them to another service.

Xcode: Download mp3 file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am writing an app where, I can enter URL of a mp3 file from web and when i click download, the app will download it in the app. Can someone help me ?
I am new to ios development. I am trying to learn Swift
Xcode 8 • Swift 3
if let audioUrl = URL(string: "http://freetone.org/ring/stan/iPhone_5-Alarm.mp3") {
// then lets create your document folder url
let documentsDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
// lets create your destination file url
let destinationUrl = documentsDirectoryURL.appendingPathComponent(audioUrl.lastPathComponent)
print(destinationUrl)
// to check if it exists before downloading it
if FileManager.default.fileExists(atPath: destinationUrl.path) {
print("The file already exists at path")
// if the file doesn't exist
} else {
// you can use NSURLSession.sharedSession to download the data asynchronously
URLSession.shared.downloadTask(with: audioUrl) { location, response, error in
guard let location = location, error == nil else { return }
do {
// after downloading your file you need to move it to your destination url
try FileManager.default.moveItem(at: location, to: destinationUrl)
print("File moved to documents folder")
} catch {
print(error)
}
}.resume()
}
}

What programing languages can be used to send emails [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am about to start writing a program that will have a GUI interface with the user that prompts for a number between 1-100. The program then emails me that number(this program would be running on an unknown users computer).
I am unable to decide what programing language to use for such a project. Can anyone suggest a language that is able to do GUI, and send emails from someone elses computer? (Preferable be able to save this program as a .exe or some single file that can be run from their computer. Also would prefer a link as to how to email in that language, but I am fine doing that research myself, just unsure what language to start researching in. If I left anything out please leave a comment asking for clarification. Thanks for any help I can get.
Use C# cus you know it's awesome (heavily biased answer) and here's the code
private bool sendMsg (string from, string to, string subject , string messageBody)
{
MailMessage message = null;
try
{
message = new MailMessage(from, to);
using (message) {
message.Subject = subject;
//message.CC.Add(CCemailAddress);
message.Body = messageBody;
message.IsBodyHtml = false;
SmtpClient client = new SmtpClient("smtp.outlook.com", 587);
client.Credentials = new System.Net.NetworkCredential(from, "Sending Accounts Password");
client.UseDefaultCredentials = false;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true; //enable SSL
client.Send(message);
client.Dispose();
}
}
catch
{
return false;
}
message.Dispose();
return true;
}

asp.net mvc3, api twitter [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Somebody can explain me this code :
auth = new MvcAuthorizer
{
Credentials = credentials
};
auth.CompleteAuthorization(Request.Url);
var auth = new MvcAuthorizer
{
Credentials = new SessionStateCredentials()
{
ConsumerKey = this.client.ConsumerKey,
ConsumerSecret = this.client.ConsumerSecret,
OAuthToken = identity.Token.Token
}
};
the difference between the two codes
Thanks,
Logically, there is no difference. I'm making the assumption that "credentials" in the first example is a SessionStateCredentials that was instantiated previously in the code. The second example uses object initialization syntax to do the same thing.

Resources