Complimenting the PDF writer (which is being unified from having separate 2D/3D variants), this one would read vector/raster features out of geospatial PDFs
Would also use to compare non-geospatial vector PDFS. Also would like to use one of the read PDF files as a template over which additional content might be added.
This would make some of my projects a lot easier. For a certain client I have to design a map in vector and then deliver individual layers as PNG files (sometimes in excess of 20000 pixels per side). My current workflow is to write out individual PDF's from Illustrator and rasterize them in Photoshop. This often takes a lot of time and requires some manual actions by me (open file, set size, save file). If I could just run it through FME that would at the very least save me the manual work.
I can confirm that we've been laying the groundwork for this. Won't be in 2016.1, but I'd be surprised if we didn't a form of PDF reading by end of calendar 2016. @ciarab can I ask you to send a couple sample PDFs into support@safe.com so we can be sure your scenario is targetted?
I never realized I have to do this but true enough I have are projects that would require this. Thanks for the update @daleatsafe. If you need some more PDFs to try let me know.
We have been using A-PDF Data extractor to extract data from pdfs. We use a system caller to connect to the app. We hope to see a similiar feature directly in FME without the need of a 3rd party app.
I tried to read text from a pdf file using a PythonCaller and the pdfminer plugin, and it went pretty well. For a start? Like this:
import fme
import fmeobjects
import sys
import chardet
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter
from pdfminer.layout import LAParams
from cStringIO import StringIO
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
data = FME_MacroValues['SourcePdfFile']
fp = file(data, 'rb')
rsrcmgr = PDFResourceManager()
retstr = StringIO()
codec = 'utf-8'
laparams = LAParams()
device = TextConverter(rsrcmgr, retstr, codec=codec, laparams=laparams)
# Create a PDF interpreter object.
interpreter = PDFPageInterpreter(rsrcmgr, device)
# Process each page contained in the document.
for page in PDFPage.get_pages(fp):
interpreter.process_page(page)
data = retstr.getvalue()
e = chardet.detect(data)
u = None
try:
if e['confidence'] > 0.3:
u = unicode(data, e['encoding'])
except:
pass
if u:
feature.setAttribute('pdfcontent', u)
else:
feature.setAttribute('pdfcontent', data)
pass
Hi all -- what better way to start the year than to try out the new PDF reader in FME 2018 betas. Builds 18236 and later have it. Get it from http://www.safe.com/download and let us know what you think. @ciarab @marko @redgeographics @geospatiallover @gschleusner @sigtill @cartoscro @dannymatranga @zubairsm FYI
Me also, but on MS windows the latest binary I could find was for v0.51, quite a way behind the latest. Not that it seems to matter for simple image extraction.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.