I am using quarto book in Rstudio. Rendering to pdf used to work but now that I have added an image it stopped working with the following error (Rendering to html still works perfectly):
Error running filter /opt/quarto/share/filters/quarto-init/quarto-init.lua:
/opt/quarto/share/filters/quarto-init/quarto-init.lua:246: attempt to index a nil value (global 'text')
stack traceback:
/opt/quarto/share/filters/quarto-init/quarto-init.lua:16: in local 'fn'
/opt/quarto/share/filters/quarto-init/quarto-init.lua:554: in function </opt/quarto/share/filters/quarto-init/quarto-init.lua:548>
Has someone encountered this before and knows what to do?
I have updated to the latest quarto (1.0.38) and Rstudio but the error still persists.
Solved.
The image path had an extra \ eg. \images\img1.png.
Once changed to images\img1.png. it worked fine
I'm a new programmer and I'm making a first attempt at a larger data science project. To do this I have made a class that is supposed to open PDFs with ocrmypdf and then uses a while statement to walk through all the documents in a folder.
class DocumentReader:
This class is used to open and read a
# document using OCR and then
# creating the document in its place
def __init__(self,file):
self.file = file
def convert(self):
ocrmypdf.ocr(self.file,new_doc,deskew=True)
and here is the while statement:
count = 0
while count <final:
for file in os.listdir('PayStubs'):
if file.endswith(".pdf"):
index = str(file).find('.pdf')
new_doc = file[:index]+'_new'+file[index:]
d1=DocumentReader(file)
d1.convert()
I can make each of the classes work if I run them individually but it is the '.pdf' extension when I try to run them programmatically that is messing me up. Does anyone know how to create a new file name programmatically for the second argument in the ocrmypdf command?
I have tried several different ways of making this work but I keep getting errors. The most common errors that my attempts have yielded are:
InputFileError: File not found - 20070928ch6495.pdf.pdf
and
isadirectoryerror: [errno 21] is a directory: '_new/'
I'm to the point where I'm running in circles. Any help would be greatly appreciated. thanks!
enter image description here
I had already modify label.txt & tiny-yolo.cfg
but it still show up
AssertionError: labels.txt and cfg/yolov2.cfg indicate inconsistent class numbers
First i see you have tiny-yolo.cfg and yolov2.cfg, it looks like you have modified tiny-yolo.cfg but your code is running the old file yolov2.cfg.
You usually get this error when trying to train a model but your labels.txt and cfg are not compatible. Download new, or edit a new copy of the cfg file and try again. remember to leave the original in the same folder.
[OSX] [node 8.4.0] [chromeless 1.3.0]
I am trying to implement a test using chromeless. I am running the sample in a local instance, with one change of specifying the imagePath to save the image. It is running and saving an image however the image is being saved in the default location still. Any ideas on what I am doing wrong? My desire is to save the image relative to the directory the test was executed in.
Modified line below.
.screenshot({ filePath: './images/test1.png'} );
As I said it all runs but the image is still saved in the following location
/var/folders/r1/4xfjz/T/cjavyrbo70000kk.png
Looks like a known problem. See https://github.com/graphcool/chromeless/issues/282
I am trying to test implementation of FPDF. Below is the code I'm testing with, but it keeps giving me the error: "Fatal error: Class 'FPDF' not found in /home4/fwall/public_html/create-press-release.php on line 5". That is the URL to the page I am calling the below code on.
I have verified that the php file for FPDF is being required from the right spot, and it's still happening. Can anyone figure out what's going on?
require(__DIR__.'/fpdf.php'); //The fpdf folder is in my root directory.
//create a FPDF object
$pdf=new FPDF();
//set document properties
$pdf->SetAuthor('Lana Kovacevic');
$pdf->SetTitle('FPDF tutorial');
//set font for the entire document
$pdf->SetFont('Helvetica','B',20);
$pdf->SetTextColor(50,60,100);
//set up a page
$pdf->AddPage('P');
$pdf->SetDisplayMode(real,'default');
//insert an image and make it a link
//$pdf->Image('logo.png',10,20,33,0,' ','http://www.fpdf.org/');
//display the title with a border around it
$pdf->SetXY(50,20);
$pdf->SetDrawColor(50,60,100);
$pdf->Cell(100,10,'FPDF Tutorial',1,0,'C',0);
//Set x and y position for the main text, reduce font size and write content
$pdf->SetXY (10,50);
$pdf->SetFontSize(10);
$pdf->Write(5,'Congratulations! You have generated a PDF.');
//Output the document
$pdf->Output('example1.pdf','I');
This line:
require('http://siteurlredacted.com/fpdf/fpdf.php');
probably won't do what you expect. The request will make the remote server "execute" fpdf.php, returning a blank page, and your script will include an empty file. That is why it doesn't find any class to load.
You should download FPDF and put the file on your filesystem, where it is accesible to your script with no HTTP requests. You can try putting fpdf.php inside your project.
Hope this helps.