Informática, perguntado por lordinho98, 4 meses atrás

Analise o código e descubra erro, refaça

#include <string>
#include <iostream>
#include <stdexcept>

namespace net
{
namespace marcoreis
{
namespace util
{

using namespace org::apache::pdfbox::pdmodel;
using namespace org::apache::pdfbox::util;

class UtilTexto
{
/// <summary>
/// Le o conteudo (texto) de um arquivo pdf
///
/// </summary>
public:
static std::wstring extraiTextoDoPDF(const std::wstring &caminho);

///
/// <summary>
/// Extrai o conteudo do arquivo indicado
///
/// </summary>
static void main(std::wstring args[]);
};
}
}
}

//.cpp file code:

namespace net
{
namespace marcoreis
{
namespace util
{
using namespace org::apache::pdfbox::pdmodel;
using namespace org::apache::pdfbox::util;

std::wstring UtilTexto::extraiTextoDoPDF(const std::wstring &caminho)
{
PDDocument *pdfDocument = nullptr;
try
{
pdfDocument = PDDocument::load(caminho);
PDFTextStripper *stripper = new PDFTextStripper();
std::wstring texto = stripper->getText(pdfDocument);
return texto;
}
catch (IOException e)
{
throw std::exception(e);
}
//JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to the exception 'finally' clause:
finally
{
if (pdfDocument != nullptr)
{
try
{
pdfDocument->close();
}
catch (IOException e)
{
throw std::exception(e);
}
}
}
}

void UtilTexto::main(std::wstring args[])
{
std::wstring caminho = L"/Users/marcoreis/Downloads/cpc_L5869.pdf";
std::wstring texto = extraiTextoDoPDF(caminho);
std::wcout << texto << std::endl;
}
}
}
}​

Soluções para a tarefa

Respondido por marcianojose1983
0

Resposta:

include. string ___;__

Perguntas interessantes